@fnndsc/brasa 0.33.4 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/models.d.ts +1 -2
- package/dist/api/models.js.map +1 -1
- package/dist/buildinfo.json +1 -1
- package/dist/builtins/debug.d.ts +1 -1
- package/dist/builtins/debug.js +12 -8
- package/dist/builtins/debug.js.map +1 -1
- package/dist/builtins/executable.d.ts +1 -1
- package/dist/builtins/executable.js +2 -1
- package/dist/builtins/executable.js.map +1 -1
- package/dist/builtins/fs/acl.d.ts +1 -16
- package/dist/builtins/fs/acl.js +3 -1
- package/dist/builtins/fs/acl.js.map +1 -1
- package/dist/builtins/fs/archive.js +1 -1
- package/dist/builtins/fs/archive.js.map +1 -1
- package/dist/builtins/fs/cat.d.ts +1 -1
- package/dist/builtins/fs/cat.js +47 -7
- package/dist/builtins/fs/cat.js.map +1 -1
- package/dist/builtins/fs/cd.d.ts +1 -19
- package/dist/builtins/fs/cd.js +45 -94
- package/dist/builtins/fs/cd.js.map +1 -1
- package/dist/builtins/fs/configWrite.d.ts +1 -1
- package/dist/builtins/fs/configWrite.js +1 -1
- package/dist/builtins/fs/configWrite.js.map +1 -1
- package/dist/builtins/fs/cp.d.ts +1 -1
- package/dist/builtins/fs/cp.js +19 -13
- package/dist/builtins/fs/cp.js.map +1 -1
- package/dist/builtins/fs/download.d.ts +1 -1
- package/dist/builtins/fs/download.js +2 -1
- package/dist/builtins/fs/download.js.map +1 -1
- package/dist/builtins/fs/du.d.ts +10 -1
- package/dist/builtins/fs/du.js +36 -2
- package/dist/builtins/fs/du.js.map +1 -1
- package/dist/builtins/fs/edit.d.ts +1 -1
- package/dist/builtins/fs/edit.js +10 -4
- package/dist/builtins/fs/edit.js.map +1 -1
- package/dist/builtins/fs/entries.d.ts +43 -0
- package/dist/builtins/fs/entries.js +81 -0
- package/dist/builtins/fs/entries.js.map +1 -0
- package/dist/builtins/fs/ls.d.ts +1 -2
- package/dist/builtins/fs/ls.js +70 -10
- package/dist/builtins/fs/ls.js.map +1 -1
- package/dist/builtins/fs/mkdir.d.ts +1 -1
- package/dist/builtins/fs/mkdir.js +29 -20
- package/dist/builtins/fs/mkdir.js.map +1 -1
- package/dist/builtins/fs/mv.d.ts +1 -1
- package/dist/builtins/fs/mv.js +40 -23
- package/dist/builtins/fs/mv.js.map +1 -1
- package/dist/builtins/fs/pull.d.ts +1 -1
- package/dist/builtins/fs/pull.js +2 -1
- package/dist/builtins/fs/pull.js.map +1 -1
- package/dist/builtins/fs/pwd.d.ts +1 -1
- package/dist/builtins/fs/pwd.js +9 -45
- package/dist/builtins/fs/pwd.js.map +1 -1
- package/dist/builtins/fs/rm.d.ts +1 -22
- package/dist/builtins/fs/rm.js +33 -58
- package/dist/builtins/fs/rm.js.map +1 -1
- package/dist/builtins/fs/rmdir.d.ts +1 -1
- package/dist/builtins/fs/rmdir.js +21 -40
- package/dist/builtins/fs/rmdir.js.map +1 -1
- package/dist/builtins/fs/touch.d.ts +1 -1
- package/dist/builtins/fs/touch.js +64 -25
- package/dist/builtins/fs/touch.js.map +1 -1
- package/dist/builtins/fs/tree.d.ts +1 -1
- package/dist/builtins/fs/tree.js +26 -3
- package/dist/builtins/fs/tree.js.map +1 -1
- package/dist/builtins/fs/upload.d.ts +1 -1
- package/dist/builtins/fs/upload.js +3 -1
- package/dist/builtins/fs/upload.js.map +1 -1
- package/dist/builtins/fs/xattr.d.ts +1 -10
- package/dist/builtins/fs/xattr.js +3 -1
- package/dist/builtins/fs/xattr.js.map +1 -1
- package/dist/builtins/games/bytes.d.ts +1 -1
- package/dist/builtins/games/bytes.js +2 -1
- package/dist/builtins/games/bytes.js.map +1 -1
- package/dist/builtins/games/chimes.d.ts +1 -13
- package/dist/builtins/games/chimes.js +1 -1
- package/dist/builtins/games/chimes.js.map +1 -1
- package/dist/builtins/games/chrislab.d.ts +33 -0
- package/dist/builtins/games/chrislab.js +117 -0
- package/dist/builtins/games/chrislab.js.map +1 -0
- package/dist/builtins/games/cowsay.d.ts +1 -11
- package/dist/builtins/games/cowsay.js +1 -1
- package/dist/builtins/games/cowsay.js.map +1 -1
- package/dist/builtins/games/figlet.d.ts +1 -11
- package/dist/builtins/games/figlet.js +1 -1
- package/dist/builtins/games/figlet.js.map +1 -1
- package/dist/builtins/games/lab.d.ts +1 -43
- package/dist/builtins/games/lab.js +7 -111
- package/dist/builtins/games/lab.js.map +1 -1
- package/dist/builtins/games/lolcat.d.ts +1 -11
- package/dist/builtins/games/lolcat.js +1 -1
- package/dist/builtins/games/lolcat.js.map +1 -1
- package/dist/builtins/games/morse.d.ts +1 -10
- package/dist/builtins/games/morse.js +1 -1
- package/dist/builtins/games/morse.js.map +1 -1
- package/dist/builtins/games/numbers.d.ts +1 -10
- package/dist/builtins/games/numbers.js +1 -1
- package/dist/builtins/games/numbers.js.map +1 -1
- package/dist/builtins/games/play.d.ts +1 -11
- package/dist/builtins/games/play.js +1 -1
- package/dist/builtins/games/play.js.map +1 -1
- package/dist/builtins/games/qr.d.ts +1 -12
- package/dist/builtins/games/qr.js +1 -1
- package/dist/builtins/games/qr.js.map +1 -1
- package/dist/builtins/games/show.d.ts +1 -12
- package/dist/builtins/games/show.js +1 -1
- package/dist/builtins/games/show.js.map +1 -1
- package/dist/builtins/games/sky.d.ts +1 -11
- package/dist/builtins/games/sky.js +1 -1
- package/dist/builtins/games/sky.js.map +1 -1
- package/dist/builtins/games/text.d.ts +1 -10
- package/dist/builtins/games/text.js +1 -1
- package/dist/builtins/games/text.js.map +1 -1
- package/dist/builtins/games/wtf.d.ts +1 -9
- package/dist/builtins/games/wtf.js +1 -1
- package/dist/builtins/games/wtf.js.map +1 -1
- package/dist/builtins/help.d.ts +18 -15
- package/dist/builtins/help.js +51 -1200
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/net/connect.d.ts +1 -1
- package/dist/builtins/net/connect.js +2 -1
- package/dist/builtins/net/connect.js.map +1 -1
- package/dist/builtins/net/cubepath.d.ts +1 -1
- package/dist/builtins/net/cubepath.js +1 -1
- package/dist/builtins/net/cubepath.js.map +1 -1
- package/dist/builtins/net/logout.d.ts +1 -1
- package/dist/builtins/net/logout.js +1 -1
- package/dist/builtins/net/logout.js.map +1 -1
- package/dist/builtins/net/netstat.d.ts +1 -1
- package/dist/builtins/net/netstat.js +1 -2
- package/dist/builtins/net/netstat.js.map +1 -1
- package/dist/builtins/net/pacs.d.ts +1 -1
- package/dist/builtins/net/pacs.js +3 -2
- package/dist/builtins/net/pacs.js.map +1 -1
- package/dist/builtins/net/pacsUtils.js +2 -1
- package/dist/builtins/net/pacsUtils.js.map +1 -1
- package/dist/builtins/net/query.csv.js +1 -1
- package/dist/builtins/net/query.csv.js.map +1 -1
- package/dist/builtins/net/query.d.ts +2 -2
- package/dist/builtins/net/query.fanout.d.ts +1 -1
- package/dist/builtins/net/query.fanout.js +1 -1
- package/dist/builtins/net/query.fanout.js.map +1 -1
- package/dist/builtins/net/query.js +3 -2
- package/dist/builtins/net/query.js.map +1 -1
- package/dist/builtins/net/status.d.ts +1 -1
- package/dist/builtins/net/status.js +2 -1
- package/dist/builtins/net/status.js.map +1 -1
- package/dist/builtins/parametersofplugin.d.ts +1 -1
- package/dist/builtins/parametersofplugin.js +1 -1
- package/dist/builtins/parametersofplugin.js.map +1 -1
- package/dist/builtins/pluginExecute.d.ts +1 -1
- package/dist/builtins/pluginExecute.js +3 -1
- package/dist/builtins/pluginExecute.js.map +1 -1
- package/dist/builtins/proc.d.ts +1 -2
- package/dist/builtins/proc.js +4 -3
- package/dist/builtins/proc.js.map +1 -1
- package/dist/builtins/res/compute.d.ts +1 -1
- package/dist/builtins/res/compute.js +2 -1
- package/dist/builtins/res/compute.js.map +1 -1
- package/dist/builtins/res/dicom.d.ts +2 -2
- package/dist/builtins/res/dicom.js +1 -2
- package/dist/builtins/res/dicom.js.map +1 -1
- package/dist/builtins/res/expect.d.ts +1 -1
- package/dist/builtins/res/expect.js +2 -1
- package/dist/builtins/res/expect.js.map +1 -1
- package/dist/builtins/res/feed.d.ts +1 -1
- package/dist/builtins/res/feed.diagram.d.ts +1 -2
- package/dist/builtins/res/feed.diagram.js +2 -2
- package/dist/builtins/res/feed.diagram.js.map +1 -1
- package/dist/builtins/res/feed.js +3 -1
- package/dist/builtins/res/feed.js.map +1 -1
- package/dist/builtins/res/feed.tree.d.ts +1 -1
- package/dist/builtins/res/feed.tree.js +1 -1
- package/dist/builtins/res/feed.tree.js.map +1 -1
- package/dist/builtins/res/files.d.ts +1 -1
- package/dist/builtins/res/files.js +1 -1
- package/dist/builtins/res/files.js.map +1 -1
- package/dist/builtins/res/gather.d.ts +1 -1
- package/dist/builtins/res/gather.js +1 -1
- package/dist/builtins/res/gather.js.map +1 -1
- package/dist/builtins/res/gather.store.js.map +1 -1
- package/dist/builtins/res/group.d.ts +1 -1
- package/dist/builtins/res/group.js +1 -1
- package/dist/builtins/res/group.js.map +1 -1
- package/dist/builtins/res/image.d.ts +1 -20
- package/dist/builtins/res/image.js +1 -2
- package/dist/builtins/res/image.js.map +1 -1
- package/dist/builtins/res/pipeline.d.ts +1 -1
- package/dist/builtins/res/pipeline.diagram.d.ts +1 -1
- package/dist/builtins/res/pipeline.diagram.js +2 -2
- package/dist/builtins/res/pipeline.diagram.js.map +1 -1
- package/dist/builtins/res/pipeline.js +3 -1
- package/dist/builtins/res/pipeline.js.map +1 -1
- package/dist/builtins/res/play.d.ts +1 -1
- package/dist/builtins/res/play.js +2 -1
- package/dist/builtins/res/play.js.map +1 -1
- package/dist/builtins/res/plugin.d.ts +1 -1
- package/dist/builtins/res/plugin.info.d.ts +1 -1
- package/dist/builtins/res/plugin.info.js +2 -1
- package/dist/builtins/res/plugin.info.js.map +1 -1
- package/dist/builtins/res/plugin.js +2 -2
- package/dist/builtins/res/plugin.js.map +1 -1
- package/dist/builtins/res/plugininstance.d.ts +1 -1
- package/dist/builtins/res/plugininstance.js +1 -1
- package/dist/builtins/res/plugininstance.js.map +1 -1
- package/dist/builtins/res/pluginmeta.d.ts +1 -1
- package/dist/builtins/res/pluginmeta.js +1 -1
- package/dist/builtins/res/pluginmeta.js.map +1 -1
- package/dist/builtins/res/record.d.ts +1 -1
- package/dist/builtins/res/record.js +1 -1
- package/dist/builtins/res/record.js.map +1 -1
- package/dist/builtins/res/tag.d.ts +1 -1
- package/dist/builtins/res/tag.js +1 -1
- package/dist/builtins/res/tag.js.map +1 -1
- package/dist/builtins/res/user.d.ts +1 -1
- package/dist/builtins/res/user.js +2 -1
- package/dist/builtins/res/user.js.map +1 -1
- package/dist/builtins/res/workflow.d.ts +1 -1
- package/dist/builtins/res/workflow.js +1 -1
- package/dist/builtins/res/workflow.js.map +1 -1
- package/dist/builtins/store.d.ts +1 -1
- package/dist/builtins/store.js +2 -1
- package/dist/builtins/store.js.map +1 -1
- package/dist/builtins/sys/cal.d.ts +1 -12
- package/dist/builtins/sys/cal.js +1 -1
- package/dist/builtins/sys/cal.js.map +1 -1
- package/dist/builtins/sys/context.d.ts +1 -1
- package/dist/builtins/sys/context.js +1 -1
- package/dist/builtins/sys/context.js.map +1 -1
- package/dist/builtins/sys/date.d.ts +1 -12
- package/dist/builtins/sys/date.js +1 -1
- package/dist/builtins/sys/date.js.map +1 -1
- package/dist/builtins/sys/fortune.d.ts +1 -11
- package/dist/builtins/sys/fortune.js +1 -1
- package/dist/builtins/sys/fortune.js.map +1 -1
- package/dist/builtins/sys/motd.d.ts +1 -18
- package/dist/builtins/sys/motd.js +3 -3
- package/dist/builtins/sys/motd.js.map +1 -1
- package/dist/builtins/sys/notes.d.ts +1 -2
- package/dist/builtins/sys/notes.js +1 -2
- package/dist/builtins/sys/notes.js.map +1 -1
- package/dist/builtins/sys/physicalmode.d.ts +1 -1
- package/dist/builtins/sys/physicalmode.js +1 -1
- package/dist/builtins/sys/physicalmode.js.map +1 -1
- package/dist/builtins/sys/timing.d.ts +1 -1
- package/dist/builtins/sys/timing.js +1 -1
- package/dist/builtins/sys/timing.js.map +1 -1
- package/dist/builtins/sys/version.d.ts +1 -7
- package/dist/builtins/sys/version.js +1 -1
- package/dist/builtins/sys/version.js.map +1 -1
- package/dist/builtins/sys/weather.d.ts +1 -1
- package/dist/builtins/sys/weather.js +1 -1
- package/dist/builtins/sys/weather.js.map +1 -1
- package/dist/builtins/sys/whoami.d.ts +1 -1
- package/dist/builtins/sys/whoami.js +2 -1
- package/dist/builtins/sys/whoami.js.map +1 -1
- package/dist/builtins/utils.d.ts +2 -19
- package/dist/builtins/utils.js +5 -55
- package/dist/builtins/utils.js.map +1 -1
- package/dist/builtins/wildcard.d.ts +4 -53
- package/dist/builtins/wildcard.js +3 -177
- package/dist/builtins/wildcard.js.map +1 -1
- package/dist/chris/backend.d.ts +22 -0
- package/dist/chris/backend.js +102 -0
- package/dist/chris/backend.js.map +1 -0
- package/dist/chris/binEntry.js.map +1 -0
- package/dist/chris/binMount.d.ts +60 -0
- package/dist/chris/binMount.js +154 -0
- package/dist/chris/binMount.js.map +1 -0
- package/dist/{core → chris}/chiliDelegate.d.ts +1 -1
- package/dist/{core → chris}/chiliDelegate.js +1 -1
- package/dist/chris/chiliDelegate.js.map +1 -0
- package/dist/chris/chrisCommands.d.ts +14 -0
- package/dist/chris/chrisCommands.js +168 -0
- package/dist/chris/chrisCommands.js.map +1 -0
- package/dist/chris/commandFallback.d.ts +3 -0
- package/dist/chris/commandFallback.js +113 -0
- package/dist/chris/commandFallback.js.map +1 -0
- package/dist/chris/completion.d.ts +3 -0
- package/dist/chris/completion.js +100 -0
- package/dist/chris/completion.js.map +1 -0
- package/dist/chris/connect.js.map +1 -0
- package/dist/chris/debug.d.ts +10 -0
- package/dist/chris/debug.js +9 -0
- package/dist/chris/debug.js.map +1 -0
- package/dist/chris/files.d.ts +16 -0
- package/dist/chris/files.js +141 -0
- package/dist/chris/files.js.map +1 -0
- package/dist/chris/filesystem.d.ts +3 -0
- package/dist/chris/filesystem.js +57 -0
- package/dist/chris/filesystem.js.map +1 -0
- package/dist/chris/help.d.ts +16 -0
- package/dist/chris/help.js +1193 -0
- package/dist/chris/help.js.map +1 -0
- package/dist/chris/jobsState.js.map +1 -0
- package/dist/chris/mounts.d.ts +7 -0
- package/dist/chris/mounts.js +34 -0
- package/dist/chris/mounts.js.map +1 -0
- package/dist/chris/navigation.d.ts +40 -0
- package/dist/chris/navigation.js +160 -0
- package/dist/chris/navigation.js.map +1 -0
- package/dist/{core → chris}/promptContext.d.ts +2 -2
- package/dist/{core → chris}/promptContext.js +3 -3
- package/dist/chris/promptContext.js.map +1 -0
- package/dist/chris/references.d.ts +14 -0
- package/dist/chris/references.js +113 -0
- package/dist/chris/references.js.map +1 -0
- package/dist/chris/tasks.d.ts +31 -0
- package/dist/chris/tasks.js +55 -0
- package/dist/chris/tasks.js.map +1 -0
- package/dist/chris/universeLayout.js.map +1 -0
- package/dist/chris/watch.d.ts +3 -0
- package/dist/chris/watch.js +15 -0
- package/dist/chris/watch.js.map +1 -0
- package/dist/core/answerKinds.d.ts +32 -0
- package/dist/core/answerKinds.js +56 -0
- package/dist/core/answerKinds.js.map +1 -0
- package/dist/core/backend.d.ts +261 -0
- package/dist/core/backend.js +32 -0
- package/dist/core/backend.js.map +1 -0
- package/dist/core/commandOrder.d.ts +16 -0
- package/dist/core/commandOrder.js +17 -0
- package/dist/core/commandOrder.js.map +1 -0
- package/dist/core/commandRegistry.d.ts +120 -0
- package/dist/core/commandRegistry.js +124 -0
- package/dist/core/commandRegistry.js.map +1 -0
- package/dist/core/coreCommands.d.ts +16 -0
- package/dist/core/coreCommands.js +156 -0
- package/dist/core/coreCommands.js.map +1 -0
- package/dist/core/dispatch.d.ts +2 -19
- package/dist/core/dispatch.js +86 -447
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/elevation.d.ts +5 -5
- package/dist/core/elevation.js +12 -7
- package/dist/core/elevation.js.map +1 -1
- package/dist/core/engine.d.ts +28 -18
- package/dist/core/engine.js +44 -119
- package/dist/core/engine.js.map +1 -1
- package/dist/core/errorText.d.ts +14 -0
- package/dist/core/errorText.js +26 -0
- package/dist/core/errorText.js.map +1 -0
- package/dist/core/expansion.d.ts +0 -2
- package/dist/core/expansion.js +43 -101
- package/dist/core/expansion.js.map +1 -1
- package/dist/core/fileRefusal.d.ts +4 -15
- package/dist/core/fileRefusal.js +4 -26
- package/dist/core/fileRefusal.js.map +1 -1
- package/dist/core/filesystem.d.ts +27 -0
- package/dist/core/filesystem.js +45 -0
- package/dist/core/filesystem.js.map +1 -0
- package/dist/core/handlerRun.d.ts +30 -0
- package/dist/core/handlerRun.js +34 -0
- package/dist/core/handlerRun.js.map +1 -0
- package/dist/core/paths.d.ts +18 -0
- package/dist/core/paths.js +49 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/preprocess.d.ts +1 -1
- package/dist/core/preprocess.js +1 -1
- package/dist/core/preprocess.js.map +1 -1
- package/dist/core/sink.d.ts +3 -25
- package/dist/core/sink.js +0 -8
- package/dist/core/sink.js.map +1 -1
- package/dist/core/surface.d.ts +3 -179
- package/dist/core/surface.js.map +1 -1
- package/dist/core/taskWatch.d.ts +42 -0
- package/dist/core/taskWatch.js +142 -0
- package/dist/core/taskWatch.js.map +1 -0
- package/dist/core/tasks.d.ts +46 -0
- package/dist/core/tasks.js +102 -0
- package/dist/core/tasks.js.map +1 -0
- package/dist/core.d.ts +22 -0
- package/dist/core.js +23 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/completer/index.js +41 -99
- package/dist/lib/completer/index.js.map +1 -1
- package/dist/lib/prefetch.js +2 -2
- package/dist/lib/prefetch.js.map +1 -1
- package/dist/lib/vfs/listing.d.ts +1 -1
- package/dist/lib/vfs/providers/static.d.ts +15 -6
- package/dist/lib/vfs/providers/static.js +20 -43
- package/dist/lib/vfs/providers/static.js.map +1 -1
- package/dist/lib/vfs/providers/static_content.d.ts +4 -4
- package/dist/lib/vfs/providers/static_content.js +4 -24
- package/dist/lib/vfs/providers/static_content.js.map +1 -1
- package/dist/lib/vfs/vfs.d.ts +11 -2
- package/dist/lib/vfs/vfs.js +90 -51
- package/dist/lib/vfs/vfs.js.map +1 -1
- package/dist/lib/wildcard.d.ts +57 -0
- package/dist/lib/wildcard.js +183 -0
- package/dist/lib/wildcard.js.map +1 -0
- package/dist/notes.json +1 -1
- package/dist/null/backend.d.ts +29 -0
- package/dist/null/backend.js +41 -0
- package/dist/null/backend.js.map +1 -0
- package/dist/session/answer.d.ts +4 -4
- package/dist/session/answer.js +0 -2
- package/dist/session/answer.js.map +1 -1
- package/dist/session/index.d.ts +12 -10
- package/dist/session/index.js +9 -38
- package/dist/session/index.js.map +1 -1
- package/package.json +12 -6
- package/dist/builtins/fs/folderExists.d.ts +0 -8
- package/dist/builtins/fs/folderExists.js +0 -67
- package/dist/builtins/fs/folderExists.js.map +0 -1
- package/dist/command-keys.d.ts +0 -8
- package/dist/command-keys.js +0 -37
- package/dist/command-keys.js.map +0 -1
- package/dist/core/chiliDelegate.js.map +0 -1
- package/dist/core/connect.js.map +0 -1
- package/dist/core/jobsState.js.map +0 -1
- package/dist/core/promptContext.js.map +0 -1
- package/dist/lib/vfs/providers/binEntry.js.map +0 -1
- package/dist/universe/universeLayout.js.map +0 -1
- /package/dist/{lib/vfs/providers → chris}/binEntry.d.ts +0 -0
- /package/dist/{lib/vfs/providers → chris}/binEntry.js +0 -0
- /package/dist/{core → chris}/connect.d.ts +0 -0
- /package/dist/{core → chris}/connect.js +0 -0
- /package/dist/{core → chris}/jobsState.d.ts +0 -0
- /package/dist/{core → chris}/jobsState.js +0 -0
- /package/dist/{universe → chris}/universeLayout.d.ts +0 -0
- /package/dist/{universe → chris}/universeLayout.js +0 -0
package/dist/core/expansion.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* One resolver now answers for all of them, in a fixed order:
|
|
12
12
|
*
|
|
13
|
-
* . *Session pronouns
|
|
14
|
-
*
|
|
13
|
+
* . *Session pronouns*: the place the session stands (`cwd`), and those
|
|
14
|
+
* the backend answers (ChRIS: the cohort, the feed, the run, the query).
|
|
15
15
|
* . *Parameters* of the manifest being played, if one is.
|
|
16
16
|
* . *The environment*.
|
|
17
17
|
*
|
|
@@ -24,12 +24,19 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
26
26
|
import { session } from '../session/index.js';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
import { answer_get, answerKind_count, answerRow_get } from '../session/answer.js';
|
|
28
|
+
import { backendInstalled_get } from './backend.js';
|
|
29
|
+
import { answerKind_find, answerKinds_get, verbTakes_get } from './answerKinds.js';
|
|
30
|
+
/** The name the core answers for itself: where the session stands. */
|
|
31
|
+
const CORE_REFERENCE = 'cwd';
|
|
32
|
+
/**
|
|
33
|
+
* The references the backend answers.
|
|
34
|
+
*
|
|
35
|
+
* @returns Its sources, or none before a backend is installed.
|
|
36
|
+
*/
|
|
37
|
+
function referenceSources_get() {
|
|
38
|
+
return backendInstalled_get()?.references ?? [];
|
|
39
|
+
}
|
|
33
40
|
/** Whether an unanswerable reference may stand as written: what a dry run does. */
|
|
34
41
|
const standsScope = new AsyncLocalStorage();
|
|
35
42
|
/** Parameters of the manifest being played, if one is. */
|
|
@@ -72,58 +79,8 @@ export function unresolvedStands_get() {
|
|
|
72
79
|
* @returns True when the session owns it.
|
|
73
80
|
*/
|
|
74
81
|
export function reference_isReserved(name) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* What the cohort answers, for the pronoun that names part of it.
|
|
79
|
-
*
|
|
80
|
-
* @param name - The reference, such as `gather`, `gather.first.place`.
|
|
81
|
-
* @returns The values, or null when the cohort cannot answer.
|
|
82
|
-
*/
|
|
83
|
-
async function cohort_reference(name) {
|
|
84
|
-
// Loaded on demand: the resolver sits under dispatch, and the cohort sits
|
|
85
|
-
// above it in a builtin.
|
|
86
|
-
const { cohort_read } = await import('../builtins/res/gather.store.js');
|
|
87
|
-
const state = await cohort_read();
|
|
88
|
-
const members = state.series;
|
|
89
|
-
// A member has two addresses and the difference is load-bearing: where it
|
|
90
|
-
// was gathered FROM, which `pull` takes, and where it LANDED, which a
|
|
91
|
-
// viewer and a run take.
|
|
92
|
-
const wantsPlace = name.endsWith('.place');
|
|
93
|
-
const stem = wantsPlace ? name.slice(0, -'.place'.length) : name;
|
|
94
|
-
const addressOf = (member) => {
|
|
95
|
-
if (!wantsPlace)
|
|
96
|
-
return member.vfsPath;
|
|
97
|
-
const landed = member.folderPath;
|
|
98
|
-
if (typeof landed === 'string' && landed.length > 0)
|
|
99
|
-
return landed;
|
|
100
|
-
return member.kind === 'series' ? null : member.vfsPath;
|
|
101
|
-
};
|
|
102
|
-
if (stem === 'gather') {
|
|
103
|
-
const addresses = members.map(addressOf);
|
|
104
|
-
if (addresses.some((address) => address === null))
|
|
105
|
-
return null;
|
|
106
|
-
return { values: addresses };
|
|
107
|
-
}
|
|
108
|
-
const which = stem.slice('gather.'.length);
|
|
109
|
-
if (which === 'size')
|
|
110
|
-
return { values: [`${members.length}`] };
|
|
111
|
-
if (which === 'name')
|
|
112
|
-
return { values: [state.name ?? ''] };
|
|
113
|
-
const pick = (member) => {
|
|
114
|
-
if (member === undefined)
|
|
115
|
-
return null;
|
|
116
|
-
const address = addressOf(member);
|
|
117
|
-
return address === null ? null : { values: [address] };
|
|
118
|
-
};
|
|
119
|
-
if (which === 'first')
|
|
120
|
-
return pick(members[0]);
|
|
121
|
-
if (which === 'last')
|
|
122
|
-
return pick(members[members.length - 1]);
|
|
123
|
-
const nth = Number(which);
|
|
124
|
-
if (Number.isInteger(nth) && nth >= 1 && nth <= members.length)
|
|
125
|
-
return pick(members[nth - 1]);
|
|
126
|
-
return null;
|
|
82
|
+
const stem = name.split('.')[0];
|
|
83
|
+
return stem === CORE_REFERENCE || referenceSources_get().some((source) => source.name === stem);
|
|
127
84
|
}
|
|
128
85
|
/**
|
|
129
86
|
* Reads what an index names: `@SER3`, `@STD001`, `@FIL2,3,7`, `@DIR2-4`.
|
|
@@ -141,7 +98,7 @@ export function indices_parse(spec) {
|
|
|
141
98
|
if (match === null)
|
|
142
99
|
return null;
|
|
143
100
|
const kind = match[1];
|
|
144
|
-
if (
|
|
101
|
+
if (answerKind_find(kind) === undefined)
|
|
145
102
|
return null;
|
|
146
103
|
const handles = [];
|
|
147
104
|
for (const part of match[2].split(',')) {
|
|
@@ -160,25 +117,14 @@ export function indices_parse(spec) {
|
|
|
160
117
|
return handles;
|
|
161
118
|
}
|
|
162
119
|
/**
|
|
163
|
-
*
|
|
120
|
+
* The kind a refusal names, in words.
|
|
164
121
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* resolving to a path and failing three steps later for a reason that
|
|
168
|
-
* names nothing the operator typed. A verb not listed takes any kind.
|
|
122
|
+
* @param kind - A kind's code; only registered kinds are ever parsed.
|
|
123
|
+
* @returns The kind in words.
|
|
169
124
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
['pull', ['SER', 'STD', 'PAT']],
|
|
174
|
-
['cat', ['FIL']],
|
|
175
|
-
['cd', ['DIR', 'SER', 'STD']],
|
|
176
|
-
['download', ['FIL']],
|
|
177
|
-
]);
|
|
178
|
-
/** The kind a refusal names, in words. */
|
|
179
|
-
const KIND_WORDS = {
|
|
180
|
-
PAT: 'a patient', STD: 'a study', SER: 'a series', FIL: 'a file', DIR: 'a folder',
|
|
181
|
-
};
|
|
125
|
+
function kind_word(kind) {
|
|
126
|
+
return answerKind_find(kind)?.word ?? kind;
|
|
127
|
+
}
|
|
182
128
|
/** The verb the line began with, set by the dispatcher before expansion. */
|
|
183
129
|
let verbInHand = null;
|
|
184
130
|
/**
|
|
@@ -204,12 +150,16 @@ function index_resolve(name) {
|
|
|
204
150
|
const handles = indices_parse(name.slice(1));
|
|
205
151
|
if (handles === null || handles.length === 0)
|
|
206
152
|
return null;
|
|
207
|
-
|
|
153
|
+
// A verb that is given the wrong kind refuses BY NAME at expansion —
|
|
154
|
+
// "IMAGE takes a series or a folder; STD001 is a study" — rather than
|
|
155
|
+
// resolving to a path and failing three steps later for a reason that
|
|
156
|
+
// names nothing the operator typed. A verb not declared takes any kind.
|
|
157
|
+
const takes = verbInHand === null ? undefined : verbTakes_get(verbInHand);
|
|
208
158
|
const values = [];
|
|
209
159
|
for (const handle of handles) {
|
|
210
160
|
if (takes !== undefined && !takes.includes(handle.kind)) {
|
|
211
|
-
kindRefusal = `${verbInHand} takes ${takes.map(
|
|
212
|
-
+ `${handle.kind}${`${handle.ordinal}`.padStart(3, '0')} is ${
|
|
161
|
+
kindRefusal = `${verbInHand} takes ${takes.map(kind_word).join(' or ')}; `
|
|
162
|
+
+ `${handle.kind}${`${handle.ordinal}`.padStart(3, '0')} is ${kind_word(handle.kind)}.`;
|
|
213
163
|
return null;
|
|
214
164
|
}
|
|
215
165
|
const row = answerRow_get(handle);
|
|
@@ -229,26 +179,16 @@ function index_resolve(name) {
|
|
|
229
179
|
export async function reference_resolve(name) {
|
|
230
180
|
if (name.startsWith('@'))
|
|
231
181
|
return index_resolve(name);
|
|
232
|
-
if (name ===
|
|
182
|
+
if (name === CORE_REFERENCE)
|
|
233
183
|
return { values: [await session.getCWD()] };
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
if (name === 'run.place') {
|
|
243
|
-
const place = recentRunPlace_get();
|
|
244
|
-
return place === null ? null : { values: [place] };
|
|
245
|
-
}
|
|
246
|
-
if (name === 'query') {
|
|
247
|
-
const query = recentQuery_get();
|
|
248
|
-
return query === null ? null : { values: [query] };
|
|
184
|
+
const stem = name.split('.')[0];
|
|
185
|
+
for (const source of referenceSources_get()) {
|
|
186
|
+
if (source.name !== stem)
|
|
187
|
+
continue;
|
|
188
|
+
const answered = await source.resolve(name);
|
|
189
|
+
if (answered !== undefined)
|
|
190
|
+
return answered;
|
|
249
191
|
}
|
|
250
|
-
if (name === 'gather' || name.startsWith('gather.'))
|
|
251
|
-
return await cohort_reference(name);
|
|
252
192
|
const params = paramScope.getStore();
|
|
253
193
|
const given = params?.get(name);
|
|
254
194
|
if (given !== undefined)
|
|
@@ -273,12 +213,14 @@ export function reference_refusal(name) {
|
|
|
273
213
|
return `${name}: nothing is numbered yet — list something first.`;
|
|
274
214
|
const handles = indices_parse(name.slice(1));
|
|
275
215
|
if (handles === null) {
|
|
276
|
-
|
|
216
|
+
const shown = answerKinds_get().filter((kind) => kind.example !== undefined);
|
|
217
|
+
const lead = shown[0]?.code ?? 'FIL';
|
|
218
|
+
return `${name}: an index says what it counts — ${shown.map((kind) => kind.example ?? '').join(', ')} — and may list or range them (@${lead}2,3 or @${lead}2-5).`;
|
|
277
219
|
}
|
|
278
220
|
const kind = handles[0].kind;
|
|
279
221
|
const count = answerKind_count(kind);
|
|
280
222
|
return count === 0
|
|
281
|
-
? `${name}: the last answer (${numbered.source}) holds no ${
|
|
223
|
+
? `${name}: the last answer (${numbered.source}) holds no ${kind_word(kind)} rows.`
|
|
282
224
|
: `${name}: the last answer (${numbered.source}) holds ${count} ${kind} row${count === 1 ? '' : 's'}.`;
|
|
283
225
|
}
|
|
284
226
|
const hint = reference_isReserved(name)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expansion.js","sourceRoot":"","sources":["../../src/core/expansion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"expansion.js","sourceRoot":"","sources":["../../src/core/expansion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH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AAC;QACzC,MAAM,KAAK,GAAW,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,KAAK,KAAK,CAAC;YAChB,CAAC,CAAC,GAAG,IAAI,sBAAsB,QAAQ,CAAC,MAAM,cAAc,SAAS,CAAC,IAAI,CAAC,QAAQ;YACnF,CAAC,CAAC,GAAG,IAAI,sBAAsB,QAAQ,CAAC,MAAM,WAAW,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC3G,CAAC;IACD,MAAM,IAAI,GAAW,oBAAoB,CAAC,IAAI,CAAC;QAC7C,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,MAAM,IAAI,0BAA0B,IAAI,eAAe,MAAM,GAAG,CAAC;AAC1E,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file A refused file read
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @file A refused file read: the status the byte route answers with and one
|
|
3
|
+
* line for the operator. A backend names its own refusals (ChRIS:
|
|
4
|
+
* `chris/files.ts`). Its own module so a test can read it without the engine
|
|
5
|
+
* (which jest cannot load whole).
|
|
5
6
|
*/
|
|
6
7
|
/**
|
|
7
8
|
* A read the kernel refused, carrying WHY: the HTTP status the byte route
|
|
@@ -17,15 +18,3 @@ export declare class FileReadRefusal extends Error {
|
|
|
17
18
|
readonly reason: string;
|
|
18
19
|
constructor(filePath: string, status: number, reason: string);
|
|
19
20
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Reads the kernel's notes since a checkpoint and names the refusal: a
|
|
22
|
-
* status for the route and a line for the operator. CUBE's own status is
|
|
23
|
-
* taken from the note when it carries one; a file the lookup could not
|
|
24
|
-
* find is 404; anything else is the kernel's own failure, 502, so a 404
|
|
25
|
-
* never again stands for "something went wrong".
|
|
26
|
-
*
|
|
27
|
-
* @param filePath - The file asked for.
|
|
28
|
-
* @param notes - The kernel's error notes since the read began, oldest first.
|
|
29
|
-
* @returns The refusal to throw.
|
|
30
|
-
*/
|
|
31
|
-
export declare function fileRefusal_name(filePath: string, notes: ReadonlyArray<string>): FileReadRefusal;
|
package/dist/core/fileRefusal.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file A refused file read
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @file A refused file read: the status the byte route answers with and one
|
|
3
|
+
* line for the operator. A backend names its own refusals (ChRIS:
|
|
4
|
+
* `chris/files.ts`). Its own module so a test can read it without the engine
|
|
5
|
+
* (which jest cannot load whole).
|
|
5
6
|
*/
|
|
6
7
|
/**
|
|
7
8
|
* A read the kernel refused, carrying WHY: the HTTP status the byte route
|
|
@@ -22,27 +23,4 @@ export class FileReadRefusal extends Error {
|
|
|
22
23
|
this.reason = reason;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Reads the kernel's notes since a checkpoint and names the refusal: a
|
|
27
|
-
* status for the route and a line for the operator. CUBE's own status is
|
|
28
|
-
* taken from the note when it carries one; a file the lookup could not
|
|
29
|
-
* find is 404; anything else is the kernel's own failure, 502, so a 404
|
|
30
|
-
* never again stands for "something went wrong".
|
|
31
|
-
*
|
|
32
|
-
* @param filePath - The file asked for.
|
|
33
|
-
* @param notes - The kernel's error notes since the read began, oldest first.
|
|
34
|
-
* @returns The refusal to throw.
|
|
35
|
-
*/
|
|
36
|
-
export function fileRefusal_name(filePath, notes) {
|
|
37
|
-
const last = notes[notes.length - 1] ?? '';
|
|
38
|
-
const status = notes.map((note) => Number(/\b(40[0-9]|41[0-9]|5[0-9][0-9])\b/.exec(note)?.[1] ?? NaN)).find((n) => !Number.isNaN(n));
|
|
39
|
-
if (status === 403 || status === 401)
|
|
40
|
-
return new FileReadRefusal(filePath, 403, 'not yours to read: CUBE refused the bytes (403)');
|
|
41
|
-
if (status === 404 || /not found|no files found/i.test(last))
|
|
42
|
-
return new FileReadRefusal(filePath, 404, 'no such file in CUBE (404)');
|
|
43
|
-
if (status !== undefined && status >= 500)
|
|
44
|
-
return new FileReadRefusal(filePath, 502, `CUBE could not serve it (${status})`);
|
|
45
|
-
// A note reads `[function ] | message`; the operator gets the message.
|
|
46
|
-
return new FileReadRefusal(filePath, 502, last.replace(/^\[[^\]]*\]\s*\|\s*/, '').trim() || 'could not be read');
|
|
47
|
-
}
|
|
48
26
|
//# sourceMappingURL=fileRefusal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileRefusal.js","sourceRoot":"","sources":["../../src/core/fileRefusal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fileRefusal.js","sourceRoot":"","sources":["../../src/core/fileRefusal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,8CAA8C;IAC9B,MAAM,CAAS;IAC/B,oDAAoD;IACpC,MAAM,CAAS;IAE/B,YAAY,QAAgB,EAAE,MAAc,EAAE,MAAc;QAC1D,KAAK,CAAC,eAAe,QAAQ,KAAK,MAAM,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The session's filesystem, as the core reaches it: the backend's
|
|
3
|
+
* dispatcher and listing cache, or the core's own when the backend has none.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { VFSDispatcher } from '@fnndsc/fond';
|
|
8
|
+
import { type ListingCache } from './backend.js';
|
|
9
|
+
/**
|
|
10
|
+
* The filesystem every path goes through.
|
|
11
|
+
*
|
|
12
|
+
* @returns The backend's dispatcher, or the core's own.
|
|
13
|
+
*/
|
|
14
|
+
export declare function vfsDispatcher_get(): VFSDispatcher;
|
|
15
|
+
/**
|
|
16
|
+
* Where listings are kept between reads.
|
|
17
|
+
*
|
|
18
|
+
* @returns The backend's cache, or one that keeps nothing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function listingCache_get(): ListingCache;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a path's listing may be kept.
|
|
23
|
+
*
|
|
24
|
+
* @param path - The absolute path.
|
|
25
|
+
* @returns True unless the backend says otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare function listingCache_holds(path: string): boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The session's filesystem, as the core reaches it: the backend's
|
|
3
|
+
* dispatcher and listing cache, or the core's own when the backend has none.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { VFSDispatcher } from '@fnndsc/fond';
|
|
8
|
+
import { backendInstalled_get } from './backend.js';
|
|
9
|
+
/** A cache that keeps nothing: every listing is read afresh. */
|
|
10
|
+
const NO_CACHE = {
|
|
11
|
+
cache_get: () => null,
|
|
12
|
+
cache_set: () => undefined,
|
|
13
|
+
};
|
|
14
|
+
/** The core's own dispatcher, for a backend with no filesystem: its mounts, and nothing beneath them. */
|
|
15
|
+
let coreDispatcher = null;
|
|
16
|
+
/**
|
|
17
|
+
* The filesystem every path goes through.
|
|
18
|
+
*
|
|
19
|
+
* @returns The backend's dispatcher, or the core's own.
|
|
20
|
+
*/
|
|
21
|
+
export function vfsDispatcher_get() {
|
|
22
|
+
const own = backendInstalled_get()?.vfs;
|
|
23
|
+
if (own !== undefined)
|
|
24
|
+
return own.dispatcher;
|
|
25
|
+
coreDispatcher ??= new VFSDispatcher();
|
|
26
|
+
return coreDispatcher;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Where listings are kept between reads.
|
|
30
|
+
*
|
|
31
|
+
* @returns The backend's cache, or one that keeps nothing.
|
|
32
|
+
*/
|
|
33
|
+
export function listingCache_get() {
|
|
34
|
+
return backendInstalled_get()?.vfs?.cache ?? NO_CACHE;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Whether a path's listing may be kept.
|
|
38
|
+
*
|
|
39
|
+
* @param path - The absolute path.
|
|
40
|
+
* @returns True unless the backend says otherwise.
|
|
41
|
+
*/
|
|
42
|
+
export function listingCache_holds(path) {
|
|
43
|
+
return backendInstalled_get()?.vfs?.cache_holds?.(path) ?? true;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=filesystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/core/filesystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAA6C,MAAM,cAAc,CAAC;AAE/F,gEAAgE;AAChE,MAAM,QAAQ,GAAiB;IAC7B,SAAS,EAAE,GAAS,EAAE,CAAC,IAAI;IAC3B,SAAS,EAAE,GAAS,EAAE,CAAC,SAAS;CACjC,CAAC;AAEF,yGAAyG;AACzG,IAAI,cAAc,GAAyB,IAAI,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAkC,oBAAoB,EAAE,EAAE,GAAG,CAAC;IACvE,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,UAAU,CAAC;IAC7C,cAAc,KAAK,IAAI,aAAa,EAAE,CAAC;IACvC,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,oBAAoB,EAAE,EAAE,GAAG,EAAE,KAAK,IAAI,QAAQ,CAAC;AACxD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,oBAAoB,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Running a printing command handler, and reading the outcome it left.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandEnvelope } from '@fnndsc/menu';
|
|
7
|
+
import type { CommandHandler } from './commandRegistry.js';
|
|
8
|
+
/**
|
|
9
|
+
* Reads the current process exit code as a number.
|
|
10
|
+
*
|
|
11
|
+
* @returns The exit code, treating an unset code as zero.
|
|
12
|
+
*/
|
|
13
|
+
export declare function exitCode_read(): number;
|
|
14
|
+
/**
|
|
15
|
+
* Runs a printing handler uncaptured, preserving an explicit envelope or
|
|
16
|
+
* deriving one from the exit-code delta for legacy handlers.
|
|
17
|
+
*
|
|
18
|
+
* This is the passthrough for commands that cannot be captured yet: the
|
|
19
|
+
* interactive holdouts (their prompts must reach the terminal) and the
|
|
20
|
+
* progress writers (their live updates must stay live). The handler prints
|
|
21
|
+
* exactly as it always has; the placeholder envelope records only the
|
|
22
|
+
* outcome, with no rendered text, so envelope consumers never re-print what
|
|
23
|
+
* the terminal already showed. Migrated handlers may return that envelope
|
|
24
|
+
* directly while retaining the same live-output behavior.
|
|
25
|
+
*
|
|
26
|
+
* @param handler - A legacy printing command handler.
|
|
27
|
+
* @param args - Parsed arguments.
|
|
28
|
+
* @returns A placeholder envelope carrying the command's outcome.
|
|
29
|
+
*/
|
|
30
|
+
export declare function handler_runDirect(handler: CommandHandler, args: string[]): Promise<CommandEnvelope>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the current process exit code as a number.
|
|
3
|
+
*
|
|
4
|
+
* @returns The exit code, treating an unset code as zero.
|
|
5
|
+
*/
|
|
6
|
+
export function exitCode_read() {
|
|
7
|
+
return typeof process.exitCode === 'number' ? process.exitCode : 0;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Runs a printing handler uncaptured, preserving an explicit envelope or
|
|
11
|
+
* deriving one from the exit-code delta for legacy handlers.
|
|
12
|
+
*
|
|
13
|
+
* This is the passthrough for commands that cannot be captured yet: the
|
|
14
|
+
* interactive holdouts (their prompts must reach the terminal) and the
|
|
15
|
+
* progress writers (their live updates must stay live). The handler prints
|
|
16
|
+
* exactly as it always has; the placeholder envelope records only the
|
|
17
|
+
* outcome, with no rendered text, so envelope consumers never re-print what
|
|
18
|
+
* the terminal already showed. Migrated handlers may return that envelope
|
|
19
|
+
* directly while retaining the same live-output behavior.
|
|
20
|
+
*
|
|
21
|
+
* @param handler - A legacy printing command handler.
|
|
22
|
+
* @param args - Parsed arguments.
|
|
23
|
+
* @returns A placeholder envelope carrying the command's outcome.
|
|
24
|
+
*/
|
|
25
|
+
export async function handler_runDirect(handler, args) {
|
|
26
|
+
const exitCodeBefore = exitCode_read();
|
|
27
|
+
const explicitEnvelope = await handler(args);
|
|
28
|
+
if (explicitEnvelope !== undefined)
|
|
29
|
+
return explicitEnvelope;
|
|
30
|
+
const exitCodeAfter = exitCode_read();
|
|
31
|
+
const failed = exitCodeAfter !== 0 && exitCodeAfter !== exitCodeBefore;
|
|
32
|
+
return { status: failed ? 'error' : 'ok', rendered: '' };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=handlerRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlerRun.js","sourceRoot":"","sources":["../../src/core/handlerRun.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAuB,EAAE,IAAc;IAC7E,MAAM,cAAc,GAAW,aAAa,EAAE,CAAC;IAC/C,MAAM,gBAAgB,GAA2B,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO,gBAAgB,CAAC;IAC5D,MAAM,aAAa,GAAW,aAAa,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAY,aAAa,KAAK,CAAC,IAAI,aAAa,KAAK,cAAc,CAAC;IAChF,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a path against a home and a working directory, without asking
|
|
3
|
+
* anything: `~` and `~/x` under the home, a relative path under the working
|
|
4
|
+
* directory, and no trailing slash.
|
|
5
|
+
*
|
|
6
|
+
* @param inputPath - The path as typed.
|
|
7
|
+
* @param home - The session's home.
|
|
8
|
+
* @param cwd - The working directory.
|
|
9
|
+
* @returns The absolute path.
|
|
10
|
+
*/
|
|
11
|
+
export declare function path_resolveFrom(inputPath: string, home: string, cwd: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Resolves a path argument as the session means it.
|
|
14
|
+
*
|
|
15
|
+
* @param inputPath - The path as typed.
|
|
16
|
+
* @returns The absolute path.
|
|
17
|
+
*/
|
|
18
|
+
export declare function path_resolve(inputPath: string): Promise<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A path as the session means it: `~` is the session's home, and a
|
|
3
|
+
* relative path stands under the working directory.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import { session } from '../session/index.js';
|
|
9
|
+
import { backendInstalled_get } from './backend.js';
|
|
10
|
+
/**
|
|
11
|
+
* Resolves a path against a home and a working directory, without asking
|
|
12
|
+
* anything: `~` and `~/x` under the home, a relative path under the working
|
|
13
|
+
* directory, and no trailing slash.
|
|
14
|
+
*
|
|
15
|
+
* @param inputPath - The path as typed.
|
|
16
|
+
* @param home - The session's home.
|
|
17
|
+
* @param cwd - The working directory.
|
|
18
|
+
* @returns The absolute path.
|
|
19
|
+
*/
|
|
20
|
+
export function path_resolveFrom(inputPath, home, cwd) {
|
|
21
|
+
let resolved = inputPath;
|
|
22
|
+
if (inputPath.startsWith('~')) {
|
|
23
|
+
if (inputPath === '~' || inputPath === '~/') {
|
|
24
|
+
resolved = home;
|
|
25
|
+
}
|
|
26
|
+
else if (inputPath.startsWith('~/')) {
|
|
27
|
+
resolved = path.posix.join(home, inputPath.substring(2));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (!resolved.startsWith('/')) {
|
|
31
|
+
resolved = path.posix.resolve(cwd, resolved);
|
|
32
|
+
}
|
|
33
|
+
if (resolved.length > 1 && resolved.endsWith('/')) {
|
|
34
|
+
resolved = resolved.slice(0, -1);
|
|
35
|
+
}
|
|
36
|
+
return resolved;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolves a path argument as the session means it.
|
|
40
|
+
*
|
|
41
|
+
* @param inputPath - The path as typed.
|
|
42
|
+
* @returns The absolute path.
|
|
43
|
+
*/
|
|
44
|
+
export async function path_resolve(inputPath) {
|
|
45
|
+
const home = (await backendInstalled_get()?.session.home_get()) ?? '/';
|
|
46
|
+
const cwd = await session.getCWD();
|
|
47
|
+
return path_resolveFrom(inputPath, home, cwd);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/core/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EA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AAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/core/preprocess.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as path from 'path';
|
|
8
8
|
import { statSync } from 'fs';
|
|
9
|
-
import { Ok, Err, errorStack } from '@fnndsc/cumin';
|
|
10
9
|
import { catArgument_isOption } from '../builtins/fs/cat.args.js';
|
|
11
10
|
import { args_tokenize } from '../lib/parser.js';
|
|
11
|
+
import { Ok, Err, errorStack } from '@fnndsc/fond';
|
|
12
12
|
/**
|
|
13
13
|
* Determines whether an argument belongs to the CFS/VFS shell namespace.
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preprocess.js","sourceRoot":"","sources":["../../src/core/preprocess.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"preprocess.js","sourceRoot":"","sources":["../../src/core/preprocess.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAU,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAAe,EACf,KAAa,EACb,aAAqB,EACrB,OAA0B,EAAE;IAE5B,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAC3B,M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,CAAC,EAAE,CAAC;QAC1B,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,oBAAoB,QAAQ,iFAAiF,CAAC,CAAC;QAC9I,OAAO,GAAG,EAAE,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAW,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/core/sink.d.ts
CHANGED
|
@@ -21,32 +21,10 @@
|
|
|
21
21
|
* @see docs/calypso.adoc for the governing design.
|
|
22
22
|
* @module
|
|
23
23
|
*/
|
|
24
|
-
import type { CommandEnvelope } from '@fnndsc/cumin';
|
|
25
24
|
import { type ProgressEvent, type ProgressRenderer } from './progress.js';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export interface OutputSink {
|
|
30
|
-
/**
|
|
31
|
-
* Writes command output (the data channel).
|
|
32
|
-
*
|
|
33
|
-
* @param chunk - Printable text (ANSI permitted) or raw bytes.
|
|
34
|
-
*/
|
|
35
|
-
data_write(chunk: string | Buffer): void;
|
|
36
|
-
/**
|
|
37
|
-
* Writes error-stream output (the err channel).
|
|
38
|
-
*
|
|
39
|
-
* @param chunk - Printable text (ANSI permitted) or raw bytes.
|
|
40
|
-
*/
|
|
41
|
-
err_write(chunk: string | Buffer): void;
|
|
42
|
-
/**
|
|
43
|
-
* Writes an ephemeral status line (the status channel).
|
|
44
|
-
*
|
|
45
|
-
* @param text - Transient text; consumers may overwrite or drop it.
|
|
46
|
-
*/
|
|
47
|
-
status_write(text: string): void;
|
|
48
|
-
progress_write(event: ProgressEvent): void;
|
|
49
|
-
}
|
|
25
|
+
import type { OutputSink } from '@fnndsc/menu/surface';
|
|
26
|
+
import type { CommandEnvelope } from '@fnndsc/menu';
|
|
27
|
+
export type { OutputSink } from '@fnndsc/menu/surface';
|
|
50
28
|
/**
|
|
51
29
|
* Sink that writes both channels to the process's standard output.
|
|
52
30
|
*
|