nextclaw 0.46.0 → 0.47.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.
Files changed (111) hide show
  1. package/dist/cli/app/index.js +1 -1
  2. package/dist/{nextclaw-cli-app-BVdP2e0w.js → nextclaw-cli-app-wU9aUEKj.js} +233 -1
  3. package/dist/nextclaw-cli-app-wU9aUEKj.js.map +1 -0
  4. package/package.json +14 -14
  5. package/resources/apps/nextclaw-github-issue-watcher/README.md +43 -0
  6. package/resources/apps/nextclaw-github-issue-watcher/guest/Cargo.lock +455 -0
  7. package/resources/apps/nextclaw-github-issue-watcher/guest/Cargo.toml +27 -0
  8. package/resources/apps/nextclaw-github-issue-watcher/guest/src/bindings.rs +11177 -0
  9. package/resources/apps/nextclaw-github-issue-watcher/guest/src/lib.rs +307 -0
  10. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/clocks@0.2.6/monotonic-clock.wit +50 -0
  11. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/clocks@0.2.6/timezone.wit +55 -0
  12. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/clocks@0.2.6/wall-clock.wit +46 -0
  13. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/clocks@0.2.6/world.wit +11 -0
  14. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/config@0.2.0-draft-2024-09-27/package.wit +1 -0
  15. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/config@0.2.0-draft-2024-09-27/store.wit +9 -0
  16. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/http@0.2.6/handler.wit +49 -0
  17. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/http@0.2.6/package.wit +1 -0
  18. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/http@0.2.6/types.wit +688 -0
  19. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/io@0.2.6/error.wit +34 -0
  20. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/io@0.2.6/poll.wit +47 -0
  21. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/io@0.2.6/streams.wit +290 -0
  22. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/io@0.2.6/world.wit +10 -0
  23. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/deps/keyvalue@0.2.0-draft2/store.wit +124 -0
  24. package/resources/apps/nextclaw-github-issue-watcher/guest/wit/portable-service.wit +56 -0
  25. package/resources/apps/nextclaw-github-issue-watcher/manifest.json +34 -0
  26. package/resources/apps/nextclaw-github-issue-watcher/marketplace.json +18 -0
  27. package/resources/apps/nextclaw-github-issue-watcher/panels/nextclaw-github-issue-watcher-panel.panel/assets/app.js +148 -0
  28. package/resources/apps/nextclaw-github-issue-watcher/panels/nextclaw-github-issue-watcher-panel.panel/index.html +190 -0
  29. package/resources/apps/nextclaw-github-issue-watcher/panels/nextclaw-github-issue-watcher-panel.panel/panel-app.json +11 -0
  30. package/resources/apps/nextclaw-github-issue-watcher/service-components/nextclaw-github-issue-watcher-service/service-app.json +36 -0
  31. package/resources/apps/nextclaw-github-issue-watcher/service-components/nextclaw-github-issue-watcher-service/service.wasm +0 -0
  32. package/resources/apps/nextclaw-github-issue-watcher/tests/public-github-runner-smoke.tools.mjs +150 -0
  33. package/resources/apps/nextclaw-github-issue-watcher/tests/service-smoke.json +12 -0
  34. package/resources/apps/nextclaw-portable-runtime-lab/README.md +5 -3
  35. package/resources/apps/nextclaw-portable-runtime-lab/manifest.json +14 -2
  36. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-contacts.panel/assets/app.js +21 -0
  37. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-contacts.panel/index.html +1 -0
  38. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-focus.panel/assets/app.js +21 -0
  39. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-focus.panel/index.html +1 -0
  40. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-notes.panel/assets/app.js +21 -0
  41. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-notes.panel/index.html +1 -0
  42. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/assets/app.js +201 -0
  43. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/assets/style.css +42 -0
  44. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/index.html +40 -19
  45. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/panel-app.json +2 -2
  46. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-todos.panel/assets/app.js +21 -0
  47. package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-todos.panel/index.html +1 -0
  48. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-capabilities/service-app.json +110 -3
  49. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-capabilities/service.wasm +0 -0
  50. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-composition/service-app.json +12 -3
  51. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-composition/service.wasm +0 -0
  52. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-provider/service-app.json +11 -0
  53. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-provider/service.wasm +0 -0
  54. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-resident/service.wasm +0 -0
  55. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-sqlite/service-app.json +37 -0
  56. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-sqlite/service.wasm +0 -0
  57. package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-state/service.wasm +0 -0
  58. package/ui-dist/assets/{api-aEu9cEI8.js → api-n96IfCKb.js} +2 -2
  59. package/ui-dist/assets/{api-aEu9cEI8.js.gz → api-n96IfCKb.js.gz} +0 -0
  60. package/ui-dist/assets/{appearance-settings-page-z4DaHc_E.js → appearance-settings-page-C_AqxSF_.js} +1 -1
  61. package/ui-dist/assets/appearance-settings-page-C_AqxSF_.js.gz +0 -0
  62. package/ui-dist/assets/{channels-list-page-x07sGqsT.js → channels-list-page-uR-M4Ls8.js} +1 -1
  63. package/ui-dist/assets/channels-list-page-uR-M4Ls8.js.gz +0 -0
  64. package/ui-dist/assets/{confirm-dialog-BALTnP33.js → confirm-dialog-CHVBMpla.js} +1 -1
  65. package/ui-dist/assets/confirm-dialog-CHVBMpla.js.gz +0 -0
  66. package/ui-dist/assets/{desktop-capabilities-page-4-v3wKLV.js → desktop-capabilities-page-phMuNq1B.js} +1 -1
  67. package/ui-dist/assets/desktop-capabilities-page-phMuNq1B.js.gz +0 -0
  68. package/ui-dist/assets/{desktop-update-config-Cl-_XHqU.js → desktop-update-config-C77hkbor.js} +1 -1
  69. package/ui-dist/assets/desktop-update-config-C77hkbor.js.gz +0 -0
  70. package/ui-dist/assets/{extensions-DFQXmSwG.js → extensions-CQKXTqTI.js} +1 -1
  71. package/ui-dist/assets/extensions-CQKXTqTI.js.gz +0 -0
  72. package/ui-dist/assets/{index-zuqzAvNx.js → index-CLw9DuCJ.js} +4 -4
  73. package/ui-dist/assets/index-CLw9DuCJ.js.gz +0 -0
  74. package/ui-dist/assets/mcp-marketplace-page-CbWOamyW.js +1 -0
  75. package/ui-dist/assets/{mcp-marketplace-page-COUopIOc.js → mcp-marketplace-page-s9PTnSDT.js} +1 -1
  76. package/ui-dist/assets/mcp-marketplace-page-s9PTnSDT.js.gz +0 -0
  77. package/ui-dist/assets/{model-config-page-g9_-hZqZ.js → model-config-page-CxnCUWRW.js} +1 -1
  78. package/ui-dist/assets/model-config-page-CxnCUWRW.js.gz +0 -0
  79. package/ui-dist/assets/{privacy-settings-page-pNhQQT4r.js → privacy-settings-page-D8HZHHjL.js} +1 -1
  80. package/ui-dist/assets/privacy-settings-page-D8HZHHjL.js.gz +0 -0
  81. package/ui-dist/assets/{providers-config-page-DftW_6KU.js → providers-config-page-C0GIoGxm.js} +1 -1
  82. package/ui-dist/assets/providers-config-page-C0GIoGxm.js.gz +0 -0
  83. package/ui-dist/assets/remote-DvTCSAxQ.js +1 -0
  84. package/ui-dist/assets/{runtime-config-page-Cd9sOYvn.js → runtime-config-page-VNJZui5f.js} +1 -1
  85. package/ui-dist/assets/runtime-config-page-VNJZui5f.js.gz +0 -0
  86. package/ui-dist/assets/{search-config-page-BqoDbKpM.js → search-config-page-D3_qNXbB.js} +1 -1
  87. package/ui-dist/assets/search-config-page-D3_qNXbB.js.gz +0 -0
  88. package/ui-dist/assets/{secrets-config-page-GsahsEVw.js → secrets-config-page-Be4P1E8o.js} +1 -1
  89. package/ui-dist/assets/secrets-config-page-Be4P1E8o.js.gz +0 -0
  90. package/ui-dist/assets/security-config-BtcpKIhQ.js +1 -0
  91. package/ui-dist/assets/{tag-chip-ClBWeQ4p.js → tag-chip-Dc_NcCEe.js} +1 -1
  92. package/ui-dist/index.html +5 -5
  93. package/ui-dist/index.html.gz +0 -0
  94. package/dist/nextclaw-cli-app-BVdP2e0w.js.map +0 -1
  95. package/ui-dist/assets/appearance-settings-page-z4DaHc_E.js.gz +0 -0
  96. package/ui-dist/assets/channels-list-page-x07sGqsT.js.gz +0 -0
  97. package/ui-dist/assets/confirm-dialog-BALTnP33.js.gz +0 -0
  98. package/ui-dist/assets/desktop-capabilities-page-4-v3wKLV.js.gz +0 -0
  99. package/ui-dist/assets/desktop-update-config-Cl-_XHqU.js.gz +0 -0
  100. package/ui-dist/assets/extensions-DFQXmSwG.js.gz +0 -0
  101. package/ui-dist/assets/index-zuqzAvNx.js.gz +0 -0
  102. package/ui-dist/assets/mcp-marketplace-page-COUopIOc.js.gz +0 -0
  103. package/ui-dist/assets/mcp-marketplace-page-DxPPmYqh.js +0 -1
  104. package/ui-dist/assets/model-config-page-g9_-hZqZ.js.gz +0 -0
  105. package/ui-dist/assets/privacy-settings-page-pNhQQT4r.js.gz +0 -0
  106. package/ui-dist/assets/providers-config-page-DftW_6KU.js.gz +0 -0
  107. package/ui-dist/assets/remote-DS2TkMPm.js +0 -1
  108. package/ui-dist/assets/runtime-config-page-Cd9sOYvn.js.gz +0 -0
  109. package/ui-dist/assets/search-config-page-BqoDbKpM.js.gz +0 -0
  110. package/ui-dist/assets/secrets-config-page-GsahsEVw.js.gz +0 -0
  111. package/ui-dist/assets/security-config-BnHQyrtG.js +0 -1
@@ -0,0 +1,34 @@
1
+ package wasi:io@0.2.6;
2
+
3
+ @since(version = 0.2.0)
4
+ interface error {
5
+ /// A resource which represents some error information.
6
+ ///
7
+ /// The only method provided by this resource is `to-debug-string`,
8
+ /// which provides some human-readable information about the error.
9
+ ///
10
+ /// In the `wasi:io` package, this resource is returned through the
11
+ /// `wasi:io/streams/stream-error` type.
12
+ ///
13
+ /// To provide more specific error information, other interfaces may
14
+ /// offer functions to "downcast" this error into more specific types. For example,
15
+ /// errors returned from streams derived from filesystem types can be described using
16
+ /// the filesystem's own error-code type. This is done using the function
17
+ /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`
18
+ /// parameter and returns an `option<wasi:filesystem/types/error-code>`.
19
+ ///
20
+ /// The set of functions which can "downcast" an `error` into a more
21
+ /// concrete type is open.
22
+ @since(version = 0.2.0)
23
+ resource error {
24
+ /// Returns a string that is suitable to assist humans in debugging
25
+ /// this error.
26
+ ///
27
+ /// WARNING: The returned string should not be consumed mechanically!
28
+ /// It may change across platforms, hosts, or other implementation
29
+ /// details. Parsing this string is a major platform-compatibility
30
+ /// hazard.
31
+ @since(version = 0.2.0)
32
+ to-debug-string: func() -> string;
33
+ }
34
+ }
@@ -0,0 +1,47 @@
1
+ package wasi:io@0.2.6;
2
+
3
+ /// A poll API intended to let users wait for I/O events on multiple handles
4
+ /// at once.
5
+ @since(version = 0.2.0)
6
+ interface poll {
7
+ /// `pollable` represents a single I/O event which may be ready, or not.
8
+ @since(version = 0.2.0)
9
+ resource pollable {
10
+
11
+ /// Return the readiness of a pollable. This function never blocks.
12
+ ///
13
+ /// Returns `true` when the pollable is ready, and `false` otherwise.
14
+ @since(version = 0.2.0)
15
+ ready: func() -> bool;
16
+
17
+ /// `block` returns immediately if the pollable is ready, and otherwise
18
+ /// blocks until ready.
19
+ ///
20
+ /// This function is equivalent to calling `poll.poll` on a list
21
+ /// containing only this pollable.
22
+ @since(version = 0.2.0)
23
+ block: func();
24
+ }
25
+
26
+ /// Poll for completion on a set of pollables.
27
+ ///
28
+ /// This function takes a list of pollables, which identify I/O sources of
29
+ /// interest, and waits until one or more of the events is ready for I/O.
30
+ ///
31
+ /// The result `list<u32>` contains one or more indices of handles in the
32
+ /// argument list that is ready for I/O.
33
+ ///
34
+ /// This function traps if either:
35
+ /// - the list is empty, or:
36
+ /// - the list contains more elements than can be indexed with a `u32` value.
37
+ ///
38
+ /// A timeout can be implemented by adding a pollable from the
39
+ /// wasi-clocks API to the list.
40
+ ///
41
+ /// This function does not return a `result`; polling in itself does not
42
+ /// do any I/O so it doesn't fail. If any of the I/O sources identified by
43
+ /// the pollables has an error, it is indicated by marking the source as
44
+ /// being ready for I/O.
45
+ @since(version = 0.2.0)
46
+ poll: func(in: list<borrow<pollable>>) -> list<u32>;
47
+ }
@@ -0,0 +1,290 @@
1
+ package wasi:io@0.2.6;
2
+
3
+ /// WASI I/O is an I/O abstraction API which is currently focused on providing
4
+ /// stream types.
5
+ ///
6
+ /// In the future, the component model is expected to add built-in stream types;
7
+ /// when it does, they are expected to subsume this API.
8
+ @since(version = 0.2.0)
9
+ interface streams {
10
+ @since(version = 0.2.0)
11
+ use error.{error};
12
+ @since(version = 0.2.0)
13
+ use poll.{pollable};
14
+
15
+ /// An error for input-stream and output-stream operations.
16
+ @since(version = 0.2.0)
17
+ variant stream-error {
18
+ /// The last operation (a write or flush) failed before completion.
19
+ ///
20
+ /// More information is available in the `error` payload.
21
+ ///
22
+ /// After this, the stream will be closed. All future operations return
23
+ /// `stream-error::closed`.
24
+ last-operation-failed(error),
25
+ /// The stream is closed: no more input will be accepted by the
26
+ /// stream. A closed output-stream will return this error on all
27
+ /// future operations.
28
+ closed
29
+ }
30
+
31
+ /// An input bytestream.
32
+ ///
33
+ /// `input-stream`s are *non-blocking* to the extent practical on underlying
34
+ /// platforms. I/O operations always return promptly; if fewer bytes are
35
+ /// promptly available than requested, they return the number of bytes promptly
36
+ /// available, which could even be zero. To wait for data to be available,
37
+ /// use the `subscribe` function to obtain a `pollable` which can be polled
38
+ /// for using `wasi:io/poll`.
39
+ @since(version = 0.2.0)
40
+ resource input-stream {
41
+ /// Perform a non-blocking read from the stream.
42
+ ///
43
+ /// When the source of a `read` is binary data, the bytes from the source
44
+ /// are returned verbatim. When the source of a `read` is known to the
45
+ /// implementation to be text, bytes containing the UTF-8 encoding of the
46
+ /// text are returned.
47
+ ///
48
+ /// This function returns a list of bytes containing the read data,
49
+ /// when successful. The returned list will contain up to `len` bytes;
50
+ /// it may return fewer than requested, but not more. The list is
51
+ /// empty when no bytes are available for reading at this time. The
52
+ /// pollable given by `subscribe` will be ready when more bytes are
53
+ /// available.
54
+ ///
55
+ /// This function fails with a `stream-error` when the operation
56
+ /// encounters an error, giving `last-operation-failed`, or when the
57
+ /// stream is closed, giving `closed`.
58
+ ///
59
+ /// When the caller gives a `len` of 0, it represents a request to
60
+ /// read 0 bytes. If the stream is still open, this call should
61
+ /// succeed and return an empty list, or otherwise fail with `closed`.
62
+ ///
63
+ /// The `len` parameter is a `u64`, which could represent a list of u8 which
64
+ /// is not possible to allocate in wasm32, or not desirable to allocate as
65
+ /// as a return value by the callee. The callee may return a list of bytes
66
+ /// less than `len` in size while more bytes are available for reading.
67
+ @since(version = 0.2.0)
68
+ read: func(
69
+ /// The maximum number of bytes to read
70
+ len: u64
71
+ ) -> result<list<u8>, stream-error>;
72
+
73
+ /// Read bytes from a stream, after blocking until at least one byte can
74
+ /// be read. Except for blocking, behavior is identical to `read`.
75
+ @since(version = 0.2.0)
76
+ blocking-read: func(
77
+ /// The maximum number of bytes to read
78
+ len: u64
79
+ ) -> result<list<u8>, stream-error>;
80
+
81
+ /// Skip bytes from a stream. Returns number of bytes skipped.
82
+ ///
83
+ /// Behaves identical to `read`, except instead of returning a list
84
+ /// of bytes, returns the number of bytes consumed from the stream.
85
+ @since(version = 0.2.0)
86
+ skip: func(
87
+ /// The maximum number of bytes to skip.
88
+ len: u64,
89
+ ) -> result<u64, stream-error>;
90
+
91
+ /// Skip bytes from a stream, after blocking until at least one byte
92
+ /// can be skipped. Except for blocking behavior, identical to `skip`.
93
+ @since(version = 0.2.0)
94
+ blocking-skip: func(
95
+ /// The maximum number of bytes to skip.
96
+ len: u64,
97
+ ) -> result<u64, stream-error>;
98
+
99
+ /// Create a `pollable` which will resolve once either the specified stream
100
+ /// has bytes available to read or the other end of the stream has been
101
+ /// closed.
102
+ /// The created `pollable` is a child resource of the `input-stream`.
103
+ /// Implementations may trap if the `input-stream` is dropped before
104
+ /// all derived `pollable`s created with this function are dropped.
105
+ @since(version = 0.2.0)
106
+ subscribe: func() -> pollable;
107
+ }
108
+
109
+
110
+ /// An output bytestream.
111
+ ///
112
+ /// `output-stream`s are *non-blocking* to the extent practical on
113
+ /// underlying platforms. Except where specified otherwise, I/O operations also
114
+ /// always return promptly, after the number of bytes that can be written
115
+ /// promptly, which could even be zero. To wait for the stream to be ready to
116
+ /// accept data, the `subscribe` function to obtain a `pollable` which can be
117
+ /// polled for using `wasi:io/poll`.
118
+ ///
119
+ /// Dropping an `output-stream` while there's still an active write in
120
+ /// progress may result in the data being lost. Before dropping the stream,
121
+ /// be sure to fully flush your writes.
122
+ @since(version = 0.2.0)
123
+ resource output-stream {
124
+ /// Check readiness for writing. This function never blocks.
125
+ ///
126
+ /// Returns the number of bytes permitted for the next call to `write`,
127
+ /// or an error. Calling `write` with more bytes than this function has
128
+ /// permitted will trap.
129
+ ///
130
+ /// When this function returns 0 bytes, the `subscribe` pollable will
131
+ /// become ready when this function will report at least 1 byte, or an
132
+ /// error.
133
+ @since(version = 0.2.0)
134
+ check-write: func() -> result<u64, stream-error>;
135
+
136
+ /// Perform a write. This function never blocks.
137
+ ///
138
+ /// When the destination of a `write` is binary data, the bytes from
139
+ /// `contents` are written verbatim. When the destination of a `write` is
140
+ /// known to the implementation to be text, the bytes of `contents` are
141
+ /// transcoded from UTF-8 into the encoding of the destination and then
142
+ /// written.
143
+ ///
144
+ /// Precondition: check-write gave permit of Ok(n) and contents has a
145
+ /// length of less than or equal to n. Otherwise, this function will trap.
146
+ ///
147
+ /// returns Err(closed) without writing if the stream has closed since
148
+ /// the last call to check-write provided a permit.
149
+ @since(version = 0.2.0)
150
+ write: func(
151
+ contents: list<u8>
152
+ ) -> result<_, stream-error>;
153
+
154
+ /// Perform a write of up to 4096 bytes, and then flush the stream. Block
155
+ /// until all of these operations are complete, or an error occurs.
156
+ ///
157
+ /// This is a convenience wrapper around the use of `check-write`,
158
+ /// `subscribe`, `write`, and `flush`, and is implemented with the
159
+ /// following pseudo-code:
160
+ ///
161
+ /// ```text
162
+ /// let pollable = this.subscribe();
163
+ /// while !contents.is_empty() {
164
+ /// // Wait for the stream to become writable
165
+ /// pollable.block();
166
+ /// let Ok(n) = this.check-write(); // eliding error handling
167
+ /// let len = min(n, contents.len());
168
+ /// let (chunk, rest) = contents.split_at(len);
169
+ /// this.write(chunk ); // eliding error handling
170
+ /// contents = rest;
171
+ /// }
172
+ /// this.flush();
173
+ /// // Wait for completion of `flush`
174
+ /// pollable.block();
175
+ /// // Check for any errors that arose during `flush`
176
+ /// let _ = this.check-write(); // eliding error handling
177
+ /// ```
178
+ @since(version = 0.2.0)
179
+ blocking-write-and-flush: func(
180
+ contents: list<u8>
181
+ ) -> result<_, stream-error>;
182
+
183
+ /// Request to flush buffered output. This function never blocks.
184
+ ///
185
+ /// This tells the output-stream that the caller intends any buffered
186
+ /// output to be flushed. the output which is expected to be flushed
187
+ /// is all that has been passed to `write` prior to this call.
188
+ ///
189
+ /// Upon calling this function, the `output-stream` will not accept any
190
+ /// writes (`check-write` will return `ok(0)`) until the flush has
191
+ /// completed. The `subscribe` pollable will become ready when the
192
+ /// flush has completed and the stream can accept more writes.
193
+ @since(version = 0.2.0)
194
+ flush: func() -> result<_, stream-error>;
195
+
196
+ /// Request to flush buffered output, and block until flush completes
197
+ /// and stream is ready for writing again.
198
+ @since(version = 0.2.0)
199
+ blocking-flush: func() -> result<_, stream-error>;
200
+
201
+ /// Create a `pollable` which will resolve once the output-stream
202
+ /// is ready for more writing, or an error has occurred. When this
203
+ /// pollable is ready, `check-write` will return `ok(n)` with n>0, or an
204
+ /// error.
205
+ ///
206
+ /// If the stream is closed, this pollable is always ready immediately.
207
+ ///
208
+ /// The created `pollable` is a child resource of the `output-stream`.
209
+ /// Implementations may trap if the `output-stream` is dropped before
210
+ /// all derived `pollable`s created with this function are dropped.
211
+ @since(version = 0.2.0)
212
+ subscribe: func() -> pollable;
213
+
214
+ /// Write zeroes to a stream.
215
+ ///
216
+ /// This should be used precisely like `write` with the exact same
217
+ /// preconditions (must use check-write first), but instead of
218
+ /// passing a list of bytes, you simply pass the number of zero-bytes
219
+ /// that should be written.
220
+ @since(version = 0.2.0)
221
+ write-zeroes: func(
222
+ /// The number of zero-bytes to write
223
+ len: u64
224
+ ) -> result<_, stream-error>;
225
+
226
+ /// Perform a write of up to 4096 zeroes, and then flush the stream.
227
+ /// Block until all of these operations are complete, or an error
228
+ /// occurs.
229
+ ///
230
+ /// This is a convenience wrapper around the use of `check-write`,
231
+ /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with
232
+ /// the following pseudo-code:
233
+ ///
234
+ /// ```text
235
+ /// let pollable = this.subscribe();
236
+ /// while num_zeroes != 0 {
237
+ /// // Wait for the stream to become writable
238
+ /// pollable.block();
239
+ /// let Ok(n) = this.check-write(); // eliding error handling
240
+ /// let len = min(n, num_zeroes);
241
+ /// this.write-zeroes(len); // eliding error handling
242
+ /// num_zeroes -= len;
243
+ /// }
244
+ /// this.flush();
245
+ /// // Wait for completion of `flush`
246
+ /// pollable.block();
247
+ /// // Check for any errors that arose during `flush`
248
+ /// let _ = this.check-write(); // eliding error handling
249
+ /// ```
250
+ @since(version = 0.2.0)
251
+ blocking-write-zeroes-and-flush: func(
252
+ /// The number of zero-bytes to write
253
+ len: u64
254
+ ) -> result<_, stream-error>;
255
+
256
+ /// Read from one stream and write to another.
257
+ ///
258
+ /// The behavior of splice is equivalent to:
259
+ /// 1. calling `check-write` on the `output-stream`
260
+ /// 2. calling `read` on the `input-stream` with the smaller of the
261
+ /// `check-write` permitted length and the `len` provided to `splice`
262
+ /// 3. calling `write` on the `output-stream` with that read data.
263
+ ///
264
+ /// Any error reported by the call to `check-write`, `read`, or
265
+ /// `write` ends the splice and reports that error.
266
+ ///
267
+ /// This function returns the number of bytes transferred; it may be less
268
+ /// than `len`.
269
+ @since(version = 0.2.0)
270
+ splice: func(
271
+ /// The stream to read from
272
+ src: borrow<input-stream>,
273
+ /// The number of bytes to splice
274
+ len: u64,
275
+ ) -> result<u64, stream-error>;
276
+
277
+ /// Read from one stream and write to another, with blocking.
278
+ ///
279
+ /// This is similar to `splice`, except that it blocks until the
280
+ /// `output-stream` is ready for writing, and the `input-stream`
281
+ /// is ready for reading, before performing the `splice`.
282
+ @since(version = 0.2.0)
283
+ blocking-splice: func(
284
+ /// The stream to read from
285
+ src: borrow<input-stream>,
286
+ /// The number of bytes to splice
287
+ len: u64,
288
+ ) -> result<u64, stream-error>;
289
+ }
290
+ }
@@ -0,0 +1,10 @@
1
+ package wasi:io@0.2.6;
2
+
3
+ @since(version = 0.2.0)
4
+ world imports {
5
+ @since(version = 0.2.0)
6
+ import streams;
7
+
8
+ @since(version = 0.2.0)
9
+ import poll;
10
+ }
@@ -0,0 +1,124 @@
1
+ package wasi:keyvalue@0.2.0-draft2;
2
+
3
+ /// A keyvalue interface that provides eventually consistent key-value operations.
4
+ ///
5
+ /// Each of these operations acts on a single key-value pair.
6
+ ///
7
+ /// The value in the key-value pair is defined as a `u8` byte array and the intention is that it is
8
+ /// the common denominator for all data types defined by different key-value stores to handle data,
9
+ /// ensuring compatibility between different key-value stores. Note: the clients will be expecting
10
+ /// serialization/deserialization overhead to be handled by the key-value store. The value could be
11
+ /// a serialized object from JSON, HTML or vendor-specific data types like AWS S3 objects.
12
+ ///
13
+ /// Data consistency in a key value store refers to the guarantee that once a write operation
14
+ /// completes, all subsequent read operations will return the value that was written.
15
+ ///
16
+ /// Any implementation of this interface must have enough consistency to guarantee "reading your
17
+ /// writes." In particular, this means that the client should never get a value that is older than
18
+ /// the one it wrote, but it MAY get a newer value if one was written around the same time. These
19
+ /// guarantees only apply to the same client (which will likely be provided by the host or an
20
+ /// external capability of some kind). In this context a "client" is referring to the caller or
21
+ /// guest that is consuming this interface. Once a write request is committed by a specific client,
22
+ /// all subsequent read requests by the same client will reflect that write or any subsequent
23
+ /// writes. Another client running in a different context may or may not immediately see the result
24
+ /// due to the replication lag. As an example of all of this, if a value at a given key is A, and
25
+ /// the client writes B, then immediately reads, it should get B. If something else writes C in
26
+ /// quick succession, then the client may get C. However, a client running in a separate context may
27
+ /// still see A or B
28
+ interface store {
29
+ /// The set of errors which may be raised by functions in this package
30
+ variant error {
31
+ /// The host does not recognize the store identifier requested.
32
+ no-such-store,
33
+
34
+ /// The requesting component does not have access to the specified store
35
+ /// (which may or may not exist).
36
+ access-denied,
37
+
38
+ /// Some implementation-specific error has occurred (e.g. I/O)
39
+ other(string)
40
+ }
41
+
42
+ /// A response to a `list-keys` operation.
43
+ record key-response {
44
+ /// The list of keys returned by the query.
45
+ keys: list<string>,
46
+ /// The continuation token to use to fetch the next page of keys. If this is `null`, then
47
+ /// there are no more keys to fetch.
48
+ cursor: option<string>
49
+ }
50
+
51
+ /// Get the bucket with the specified identifier.
52
+ ///
53
+ /// `identifier` must refer to a bucket provided by the host.
54
+ ///
55
+ /// `error::no-such-store` will be raised if the `identifier` is not recognized.
56
+ open: func(identifier: string) -> result<bucket, error>;
57
+
58
+ /// A bucket is a collection of key-value pairs. Each key-value pair is stored as a entry in the
59
+ /// bucket, and the bucket itself acts as a collection of all these entries.
60
+ ///
61
+ /// It is worth noting that the exact terminology for bucket in key-value stores can very
62
+ /// depending on the specific implementation. For example:
63
+ ///
64
+ /// 1. Amazon DynamoDB calls a collection of key-value pairs a table
65
+ /// 2. Redis has hashes, sets, and sorted sets as different types of collections
66
+ /// 3. Cassandra calls a collection of key-value pairs a column family
67
+ /// 4. MongoDB calls a collection of key-value pairs a collection
68
+ /// 5. Riak calls a collection of key-value pairs a bucket
69
+ /// 6. Memcached calls a collection of key-value pairs a slab
70
+ /// 7. Azure Cosmos DB calls a collection of key-value pairs a container
71
+ ///
72
+ /// In this interface, we use the term `bucket` to refer to a collection of key-value pairs
73
+ resource bucket {
74
+ /// Get the value associated with the specified `key`
75
+ ///
76
+ /// The value is returned as an option. If the key-value pair exists in the
77
+ /// store, it returns `Ok(value)`. If the key does not exist in the
78
+ /// store, it returns `Ok(none)`.
79
+ ///
80
+ /// If any other error occurs, it returns an `Err(error)`.
81
+ get: func(key: string) -> result<option<list<u8>>, error>;
82
+
83
+ /// Set the value associated with the key in the store. If the key already
84
+ /// exists in the store, it overwrites the value.
85
+ ///
86
+ /// If the key does not exist in the store, it creates a new key-value pair.
87
+ ///
88
+ /// If any other error occurs, it returns an `Err(error)`.
89
+ set: func(key: string, value: list<u8>) -> result<_, error>;
90
+
91
+ /// Delete the key-value pair associated with the key in the store.
92
+ ///
93
+ /// If the key does not exist in the store, it does nothing.
94
+ ///
95
+ /// If any other error occurs, it returns an `Err(error)`.
96
+ delete: func(key: string) -> result<_, error>;
97
+
98
+ /// Check if the key exists in the store.
99
+ ///
100
+ /// If the key exists in the store, it returns `Ok(true)`. If the key does
101
+ /// not exist in the store, it returns `Ok(false)`.
102
+ ///
103
+ /// If any other error occurs, it returns an `Err(error)`.
104
+ exists: func(key: string) -> result<bool, error>;
105
+
106
+ /// Get all the keys in the store with an optional cursor (for use in pagination). It
107
+ /// returns a list of keys. Please note that for most KeyValue implementations, this is a
108
+ /// can be a very expensive operation and so it should be used judiciously. Implementations
109
+ /// can return any number of keys in a single response, but they should never attempt to
110
+ /// send more data than is reasonable (i.e. on a small edge device, this may only be a few
111
+ /// KB, while on a large machine this could be several MB). Any response should also return
112
+ /// a cursor that can be used to fetch the next page of keys. See the `key-response` record
113
+ /// for more information.
114
+ ///
115
+ /// Note that the keys are not guaranteed to be returned in any particular order.
116
+ ///
117
+ /// If the store is empty, it returns an empty list.
118
+ ///
119
+ /// MAY show an out-of-date list of keys if there are concurrent writes to the store.
120
+ ///
121
+ /// If any error occurs, it returns an `Err(error)`.
122
+ list-keys: func(cursor: option<string>) -> result<key-response, error>;
123
+ }
124
+ }
@@ -0,0 +1,56 @@
1
+ package nextclaw:portable-service@0.1.0;
2
+
3
+ interface host {
4
+ enum log-level {
5
+ debug,
6
+ info,
7
+ warn,
8
+ error,
9
+ }
10
+
11
+ record http-response {
12
+ status: u16,
13
+ body: string,
14
+ }
15
+
16
+ record runtime-info {
17
+ runner-pid: u32,
18
+ loaded-components: u32,
19
+ component-id: string,
20
+ }
21
+
22
+ log: func(level: log-level, message: string);
23
+ kv-get: func(key: string) -> result<option<string>, string>;
24
+ kv-set: func(key: string, value: string) -> result<_, string>;
25
+ http-get: func(url: string) -> result<http-response, string>;
26
+ component-call: func(provider-id: string, action: string, input-json: string) -> result<string, string>;
27
+ get-runtime-info: func() -> runtime-info;
28
+ /// A job-scoped, bounded observation channel. Older Components that do not
29
+ /// import these functions remain link-compatible with this host interface.
30
+ report-progress: func(current: option<u64>, total: option<u64>, message: option<string>) -> result<_, string>;
31
+ emit-chunk: func(content: string) -> result<_, string>;
32
+ check-cancelled: func() -> bool;
33
+ }
34
+
35
+ interface service {
36
+ record action {
37
+ name: string,
38
+ title: string,
39
+ description: string,
40
+ }
41
+
42
+ list-actions: func() -> list<action>;
43
+ invoke: func(action: string, input-json: string) -> result<string, string>;
44
+ start: func(config-json: string) -> result<string, string>;
45
+ handle-event: func(event-json: string) -> result<string, string>;
46
+ stop: func(reason-json: string) -> result<string, string>;
47
+ }
48
+
49
+ world service-app {
50
+ import host;
51
+ import wasi:http/outgoing-handler@0.2.6;
52
+ import wasi:keyvalue/store@0.2.0-draft2;
53
+ import wasi:config/store@0.2.0-draft-2024-09-27;
54
+ import wasi:clocks/wall-clock@0.2.6;
55
+ export service;
56
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "id": "nextclaw.github-issue-watcher",
4
+ "name": "GitHub Issue Watcher",
5
+ "version": "0.1.0",
6
+ "description": "同步 GitHub 仓库的 Issue,并在 NextClaw 中筛选查看。",
7
+ "engines": { "nextclaw": ">=0.46.0" },
8
+ "runtime": { "profile": "wasi" },
9
+ "distribution": { "mode": "universal" },
10
+ "storage": { "scope": "global", "schemaVersion": 1 },
11
+ "presentation": { "primaryPanel": "nextclaw-github-issue-watcher-panel" },
12
+ "permissions": {
13
+ "storage": { "namespace": "github-issue-watcher" },
14
+ "allowedDomains": ["api.github.com"],
15
+ "secrets": [
16
+ {
17
+ "id": "github-token",
18
+ "title": "GitHub Token(可选)",
19
+ "description": "用于私有仓库或更高 GitHub API 限额;不会显示给应用或用户界面。",
20
+ "required": false
21
+ }
22
+ ]
23
+ },
24
+ "components": [
25
+ {
26
+ "kind": "panel",
27
+ "path": "panels/nextclaw-github-issue-watcher-panel.panel"
28
+ },
29
+ {
30
+ "kind": "service",
31
+ "path": "service-components/nextclaw-github-issue-watcher-service"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "slug": "github-issue-watcher",
3
+ "summary": "Sync and review GitHub issues from a portable NextClaw app.",
4
+ "summaryI18n": {
5
+ "zh-CN": "在可移植的 NextClaw 应用中同步和查看 GitHub Issue。",
6
+ "en-US": "Sync and review GitHub issues from a portable NextClaw app."
7
+ },
8
+ "description": "A small reference app that uses portable HTTP, local persistent storage, and an optional secret without exposing credentials to the app.",
9
+ "descriptionI18n": {
10
+ "zh-CN": "一个真实的参考应用:使用可移植网络访问、本地持久化和可选密钥,并且不会把凭据暴露给应用。",
11
+ "en-US": "A small reference app that uses portable HTTP, local persistent storage, and an optional secret without exposing credentials to the app."
12
+ },
13
+ "author": "NextClaw",
14
+ "tags": ["github", "issues", "portable", "reference"],
15
+ "sourceRepo": "https://github.com/Peiiii/nextclaw",
16
+ "homepage": "https://nextclaw.io",
17
+ "featured": false
18
+ }