2020-01-21 23:34:50 +03:00
|
|
|
:: dbug: agent wrapper for generic debugging tools
|
|
|
|
::
|
|
|
|
:: usage: %-(agent:dbug your-agent)
|
|
|
|
::
|
|
|
|
|%
|
2020-03-12 18:40:35 +03:00
|
|
|
+$ poke
|
|
|
|
$% [%bowl ~]
|
|
|
|
[%state grab=cord]
|
|
|
|
[%incoming =about]
|
|
|
|
[%outgoing =about]
|
2020-01-21 23:34:50 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ about
|
2020-03-21 20:32:39 +03:00
|
|
|
$@ ~
|
2020-01-21 23:34:50 +03:00
|
|
|
$% [%ship =ship]
|
|
|
|
[%path =path]
|
|
|
|
[%wire =wire]
|
|
|
|
[%term =term]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ agent
|
|
|
|
|= =agent:gall
|
|
|
|
^- agent:gall
|
2020-03-28 15:26:56 +03:00
|
|
|
!.
|
2020-01-21 23:34:50 +03:00
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
ag ~(. agent bowl)
|
|
|
|
::
|
|
|
|
++ on-poke
|
|
|
|
|= [=mark =vase]
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
?. ?=(%dbug mark)
|
|
|
|
=^ cards agent (on-poke:ag mark vase)
|
|
|
|
[cards this]
|
|
|
|
=/ dbug
|
2020-03-12 18:40:35 +03:00
|
|
|
!<(poke vase)
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
=; =tang
|
2020-04-16 00:50:53 +03:00
|
|
|
((%*(. slog pri 1) tang) [~ this])
|
2020-03-12 18:40:35 +03:00
|
|
|
?- -.dbug
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
%bowl [(sell !>(bowl))]~
|
2020-03-12 18:40:35 +03:00
|
|
|
::
|
|
|
|
%state
|
|
|
|
=? grab.dbug =('' grab.dbug) '-'
|
2020-09-07 16:55:45 +03:00
|
|
|
=; product=^vase
|
|
|
|
[(sell product)]~
|
|
|
|
=/ state=^vase
|
|
|
|
:: if the underlying app has implemented a /dbug/state scry endpoint,
|
|
|
|
:: use that vase in place of +on-save's.
|
|
|
|
::
|
|
|
|
=/ result=(each ^vase tang)
|
|
|
|
(mule |.(q:(need (need (on-peek:ag /x/dbug/state)))))
|
|
|
|
?:(?=(%& -.result) p.result on-save:ag)
|
2020-03-12 18:40:35 +03:00
|
|
|
%+ slap
|
2020-09-07 16:55:45 +03:00
|
|
|
(slop state !>([bowl=bowl ..zuse]))
|
2020-03-12 18:40:35 +03:00
|
|
|
(ream grab.dbug)
|
2020-01-21 23:34:50 +03:00
|
|
|
::
|
|
|
|
%incoming
|
2020-04-15 23:28:59 +03:00
|
|
|
=; =tang
|
|
|
|
?^ tang tang
|
|
|
|
[%leaf "no matching subscriptions"]~
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
%+ murn
|
|
|
|
%+ sort ~(tap by sup.bowl)
|
|
|
|
|= [[* a=[=ship =path]] [* b=[=ship =path]]]
|
|
|
|
(aor [path ship]:a [path ship]:b)
|
|
|
|
|= [=duct [=ship =path]]
|
|
|
|
^- (unit tank)
|
2020-01-21 23:34:50 +03:00
|
|
|
=; relevant=?
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
?. relevant ~
|
|
|
|
`>[path=path from=ship duct=duct]<
|
2020-03-21 20:32:39 +03:00
|
|
|
?: ?=(~ about.dbug) &
|
2020-01-21 23:34:50 +03:00
|
|
|
?- -.about.dbug
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
%ship =(ship ship.about.dbug)
|
|
|
|
%path ?=(^ (find path.about.dbug path))
|
|
|
|
%wire %+ lien duct
|
2020-01-21 23:34:50 +03:00
|
|
|
|=(=wire ?=(^ (find wire.about.dbug wire)))
|
|
|
|
%term !!
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%outgoing
|
2020-04-15 23:28:59 +03:00
|
|
|
=; =tang
|
|
|
|
?^ tang tang
|
|
|
|
[%leaf "no matching subscriptions"]~
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
%+ murn
|
|
|
|
%+ sort ~(tap by wex.bowl)
|
|
|
|
|= [[[a=wire *] *] [[b=wire *] *]]
|
|
|
|
(aor a b)
|
|
|
|
|= [[=wire =ship =term] [acked=? =path]]
|
|
|
|
^- (unit tank)
|
2020-01-21 23:34:50 +03:00
|
|
|
=; relevant=?
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
?. relevant ~
|
|
|
|
`>[wire=wire agnt=[ship term] path=path ackd=acked]<
|
2020-03-21 20:32:39 +03:00
|
|
|
?: ?=(~ about.dbug) &
|
2020-01-21 23:34:50 +03:00
|
|
|
?- -.about.dbug
|
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging
on to and displaying irrelevant type information: "_list_ of subscriptions",
"wire with _head and tail_", and so on.
Here, we move to producing tangs, instead of vases, and print those. For the
%incoming and %outgoing cases, we print a line for every subscription, sorting
them by path and wire respectively, and giving clean, easily readable output.
2020-03-21 20:29:33 +03:00
|
|
|
%ship =(ship ship.about.dbug)
|
|
|
|
%path ?=(^ (find path.about.dbug path))
|
|
|
|
%wire ?=(^ (find wire.about.dbug wire))
|
|
|
|
%term =(term term.about.dbug)
|
2020-01-21 23:34:50 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2020-05-08 02:42:29 +03:00
|
|
|
++ on-peek
|
|
|
|
|= =path
|
|
|
|
^- (unit (unit cage))
|
|
|
|
?. ?=([@ %dbug *] path)
|
|
|
|
(on-peek:ag path)
|
|
|
|
?+ path [~ ~]
|
|
|
|
[%u %dbug ~] ``noun+!>(&)
|
|
|
|
[%x %dbug %state ~] ``noun+!>(on-save:ag)
|
|
|
|
[%x %dbug %subscriptions ~] ``noun+!>([wex sup]:bowl)
|
|
|
|
==
|
|
|
|
::
|
2020-01-21 23:34:50 +03:00
|
|
|
++ on-init
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent on-init:ag
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-save on-save:ag
|
|
|
|
::
|
|
|
|
++ on-load
|
|
|
|
|= old-state=vase
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent (on-load:ag old-state)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-watch
|
|
|
|
|= =path
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent (on-watch:ag path)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-leave
|
|
|
|
|= =path
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent (on-leave:ag path)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-agent
|
|
|
|
|= [=wire =sign:agent:gall]
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent (on-agent:ag wire sign)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [=wire =sign-arvo]
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent (on-arvo:ag wire sign-arvo)
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ on-fail
|
|
|
|
|= [=term =tang]
|
|
|
|
^- (quip card:agent:gall agent:gall)
|
|
|
|
=^ cards agent (on-fail:ag term tang)
|
|
|
|
[cards this]
|
|
|
|
--
|
|
|
|
--
|