Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: file / directory watcher (WIP) #13

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

feat: file / directory watcher (WIP) #13

wants to merge 7 commits into from

Conversation

dckc
Copy link
Contributor

@dckc dckc commented Apr 20, 2024

closes #12

  • align with blob store reader interface

first version that runs, after chat with Google Gemini (nee Bard)
~/projects/playground/packages/file-watcher
16:13 connolly@bldbox$ endo make --UNCONFINED ./src/FileWatchingService.js
Object [Alleged: FileWatcherFactory] {}
~/projects/playground/packages/file-watcher
16:13 connolly@bldbox$ endo make --UNCONFINED ./src/FileWatchingService.js -n fwf
Object [Alleged: FileWatcherFactory] {}
~/projects/playground/packages/file-watcher
16:14 connolly@bldbox$ endo eval "E(fwf).make('/home/connolly/Downloads')" fwf
Object [Alleged: FileWatcher] {}
~/projects/playground/packages/file-watcher
16:14 connolly@bldbox$ endo eval "E(fwf).make('/home/connolly/Downloads')" fwf -n fw
Object [Alleged: FileWatcher] {}
~/projects/playground/packages/file-watcher
16:14 connolly@bldbox$ endo eval "E(fw).watch()" fw
CapTP cli exception: (RemoteError(error:captp:Endo#20001)#1)
RemoteError(error:captp:Endo#20001)#1: cannot serialize Remotables with non-methods like "constructor" in (an object)

  at decodeErrorCommon (packages/marshal/src/marshal.js:306:24)
  at decodeErrorFromCapData (packages/marshal/src/marshal.js:334:14)
  at decodeFromCapData (packages/marshal/src/encodeToCapData.js:384:27)
  at fromCapData (packages/marshal/src/marshal.js:396:23)
  at CTP_RETURN (packages/captp/src/captp.js:695:24)
  at dispatch (packages/captp/src/captp.js:774:7)
  at packages/daemon/src/connection.js:34:7

(RemoteError(error:captp:Endo#20001)#1)
@dckc dckc marked this pull request as draft April 20, 2024 21:27
@dckc
Copy link
Contributor Author

dckc commented Apr 20, 2024

demo so far:

~/projects/playground/packages/file-watcher
16:24 connolly@bldbox$ endo purge
Are you sure you want to erase all state? This irreversible action will permanently sever all peer connections. Continue? (y/n)
y
~/projects/playground/packages/file-watcher
16:24 connolly@bldbox$ endo make --UNCONFINED ./src/FileWatchingService.js -n fwf
Object [Alleged: FileWatcherFactory] {}
~/projects/playground/packages/file-watcher
16:24 connolly@bldbox$ endo eval "E(fwf).make('/home/connolly/Downloads')" fwf
Object [Alleged: FileWatcher] {}
~/projects/playground/packages/file-watcher
16:24 connolly@bldbox$ endo eval "E(fw).watch()" fw -n es
CapTP cli exception: (RemoteError(error:captp:Endo#20001)#1)
RemoteError(error:captp:Endo#20001)#1: Unknown pet name "fw"

  at decodeErrorCommon (packages/marshal/src/marshal.js:306:24)
  at decodeErrorFromCapData (packages/marshal/src/marshal.js:334:14)
  at decodeFromCapData (packages/marshal/src/encodeToCapData.js:384:27)
  at fromCapData (packages/marshal/src/marshal.js:396:23)
  at CTP_RETURN (packages/captp/src/captp.js:695:24)
  at dispatch (packages/captp/src/captp.js:774:7)
  at packages/daemon/src/connection.js:34:7

(RemoteError(error:captp:Endo#20001)#1)
~/projects/playground/packages/file-watcher
16:24 connolly@bldbox$ endo eval "E(fwf).make('/home/connolly/Downloads')" fwf -n fw
Object [Alleged: FileWatcher] {}
~/projects/playground/packages/file-watcher
16:25 connolly@bldbox$ endo eval "E(fw).watch()" fw -n es
Object [Alleged: FileEvents] {}
~/projects/playground/packages/file-watcher
16:25 connolly@bldbox$ endo eval "E(es).next()"
CapTP cli exception: (RemoteReferenceError(error:captp:Endo#20001)#1)
RemoteReferenceError(error:captp:Endo#20001)#1: es is not defined

  at decodeErrorCommon (packages/marshal/src/marshal.js:306:24)
  at decodeErrorFromCapData (packages/marshal/src/marshal.js:334:14)
  at decodeFromCapData (packages/marshal/src/encodeToCapData.js:384:27)
  at fromCapData (packages/marshal/src/marshal.js:396:23)
  at CTP_RETURN (packages/captp/src/captp.js:695:24)
  at dispatch (packages/captp/src/captp.js:774:7)
  at packages/daemon/src/connection.js:34:7

(RemoteReferenceError(error:captp:Endo#20001)#1)
~/projects/playground/packages/file-watcher
16:25 connolly@bldbox$ endo eval "E(es).next()" es
{ done: false, value: Object [Alleged: File] {} }

@dckc
Copy link
Contributor Author

dckc commented Apr 20, 2024

moar

~/projects/playground/packages/file-watcher
16:25 connolly@bldbox$ endo eval "E(es).next()"
CapTP cli exception: (RemoteReferenceError(error:captp:Endo#20001)#1)
RemoteReferenceError(error:captp:Endo#20001)#1: es is not defined

  at decodeErrorCommon (packages/marshal/src/marshal.js:306:24)
  at decodeErrorFromCapData (packages/marshal/src/marshal.js:334:14)
  at decodeFromCapData (packages/marshal/src/encodeToCapData.js:384:27)
  at fromCapData (packages/marshal/src/marshal.js:396:23)
  at CTP_RETURN (packages/captp/src/captp.js:695:24)
  at dispatch (packages/captp/src/captp.js:774:7)
  at packages/daemon/src/connection.js:34:7

(RemoteReferenceError(error:captp:Endo#20001)#1)
~/projects/playground/packages/file-watcher
16:25 connolly@bldbox$ endo eval "E(es).next()" es
{ done: false, value: Object [Alleged: File] {} }
~/projects/playground/packages/file-watcher
16:25 connolly@bldbox$ endo eval "E(es).next()" es -n f2
{ done: false, value: Object [Alleged: File] {} }
~/projects/playground/packages/file-watcher
16:28 connolly@bldbox$ endo eval "E(f2).getName()" f2
CapTP cli exception: (RemoteTypeError(error:captp:Endo#20001)#1)
RemoteTypeError(error:captp:Endo#20001)#1: target has no method "getName", has []

  at decodeErrorCommon (packages/marshal/src/marshal.js:306:24)
  at decodeErrorFromCapData (packages/marshal/src/marshal.js:334:14)
  at decodeFromCapData (packages/marshal/src/encodeToCapData.js:384:27)
  at fromCapData (packages/marshal/src/marshal.js:396:23)
  at CTP_RETURN (packages/captp/src/captp.js:695:24)
  at dispatch (packages/captp/src/captp.js:774:7)
  at packages/daemon/src/connection.js:34:7

(RemoteTypeError(error:captp:Endo#20001)#1)
~/projects/playground/packages/file-watcher
16:29 connolly@bldbox$ endo eval "E(f2.value).getName()" f2
hi5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

file / directory watcher
1 participant