@valni/cli-darwin-x64 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -2
- package/package.json +1 -1
- package/runtime/LICENSE +1 -2
- package/runtime/examples/extensions/auto-commit-on-exit.ts +6 -6
- package/runtime/examples/extensions/bash-spawn-hook.ts +3 -3
- package/runtime/examples/extensions/bookmark.ts +5 -5
- package/runtime/examples/extensions/border-status-editor.ts +7 -7
- package/runtime/examples/extensions/built-in-tool-renderer.ts +6 -6
- package/runtime/examples/extensions/claude-rules.ts +4 -4
- package/runtime/examples/extensions/commands.ts +5 -5
- package/runtime/examples/extensions/confirm-destructive.ts +3 -3
- package/runtime/examples/extensions/custom-footer.ts +2 -2
- package/runtime/examples/extensions/custom-header.ts +5 -5
- package/runtime/examples/extensions/custom-provider-anthropic/index.ts +4 -4
- package/runtime/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/runtime/examples/extensions/custom-provider-anthropic/package.json +3 -3
- package/runtime/examples/extensions/dirty-repo-guard.ts +7 -7
- package/runtime/examples/extensions/doom-overlay/doom/build.sh +4 -4
- package/runtime/examples/extensions/doom-overlay/doom/{doomgeneric_pi.c → doomgeneric_valni.c} +1 -1
- package/runtime/examples/extensions/doom-overlay/index.ts +3 -3
- package/runtime/examples/extensions/dynamic-resources/dynamic.json +0 -1
- package/runtime/examples/extensions/dynamic-resources/index.ts +2 -4
- package/runtime/examples/extensions/dynamic-tools.ts +4 -4
- package/runtime/examples/extensions/entry-renderer.ts +6 -6
- package/runtime/examples/extensions/event-bus.ts +8 -8
- package/runtime/examples/extensions/file-trigger.ts +3 -3
- package/runtime/examples/extensions/git-checkpoint.ts +7 -7
- package/runtime/examples/extensions/git-merge-and-resolve.ts +14 -14
- package/runtime/examples/extensions/github-issue-autocomplete.ts +6 -6
- package/runtime/examples/extensions/hello.ts +2 -2
- package/runtime/examples/extensions/hidden-thinking-label.ts +4 -4
- package/runtime/examples/extensions/inline-bash.ts +5 -5
- package/runtime/examples/extensions/input-transform-streaming.ts +5 -5
- package/runtime/examples/extensions/input-transform.ts +5 -5
- package/runtime/examples/extensions/interactive-shell.ts +3 -3
- package/runtime/examples/extensions/mac-system-theme.ts +5 -5
- package/runtime/examples/extensions/message-renderer.ts +4 -4
- package/runtime/examples/extensions/minimal-mode.ts +9 -9
- package/runtime/examples/extensions/modal-editor.ts +3 -3
- package/runtime/examples/extensions/model-status.ts +3 -3
- package/runtime/examples/extensions/notify.ts +5 -5
- package/runtime/examples/extensions/overlay-qa-tests.ts +20 -20
- package/runtime/examples/extensions/overlay-test.ts +3 -3
- package/runtime/examples/extensions/permission-gate.ts +2 -2
- package/runtime/examples/extensions/pirate.ts +4 -4
- package/runtime/examples/extensions/plan-mode/index.ts +21 -21
- package/runtime/examples/extensions/preset.ts +26 -26
- package/runtime/examples/extensions/project-trust.ts +7 -7
- package/runtime/examples/extensions/prompt-customizer.ts +3 -3
- package/runtime/examples/extensions/protected-paths.ts +2 -2
- package/runtime/examples/extensions/provider-payload.ts +3 -3
- package/runtime/examples/extensions/question.ts +2 -2
- package/runtime/examples/extensions/questionnaire.ts +2 -2
- package/runtime/examples/extensions/rainbow-editor.ts +3 -3
- package/runtime/examples/extensions/reload-runtime.ts +4 -4
- package/runtime/examples/extensions/rpc-demo.ts +10 -10
- package/runtime/examples/extensions/sandbox/index.ts +15 -15
- package/runtime/examples/extensions/sandbox/package-lock.json +4 -4
- package/runtime/examples/extensions/sandbox/package.json +3 -3
- package/runtime/examples/extensions/send-user-message.ts +13 -13
- package/runtime/examples/extensions/session-name.ts +4 -4
- package/runtime/examples/extensions/shutdown-command.ts +10 -10
- package/runtime/examples/extensions/snake.ts +3 -3
- package/runtime/examples/extensions/space-invaders.ts +3 -3
- package/runtime/examples/extensions/ssh.ts +12 -12
- package/runtime/examples/extensions/status-line.ts +4 -4
- package/runtime/examples/extensions/structured-output.ts +2 -2
- package/runtime/examples/extensions/subagent/index.ts +5 -5
- package/runtime/examples/extensions/system-prompt-header.ts +3 -3
- package/runtime/examples/extensions/tic-tac-toe.ts +15 -15
- package/runtime/examples/extensions/timed-confirm.ts +4 -4
- package/runtime/examples/extensions/titlebar-spinner.ts +11 -11
- package/runtime/examples/extensions/todo.ts +5 -5
- package/runtime/examples/extensions/tool-override.ts +5 -5
- package/runtime/examples/extensions/tools.ts +10 -10
- package/runtime/examples/extensions/trigger-compact.ts +3 -3
- package/runtime/examples/extensions/truncated-tool.ts +3 -3
- package/runtime/examples/extensions/widget-placement.ts +2 -2
- package/runtime/examples/extensions/with-deps/index.ts +2 -2
- package/runtime/examples/extensions/with-deps/package-lock.json +4 -4
- package/runtime/examples/extensions/with-deps/package.json +3 -3
- package/runtime/examples/extensions/working-indicator.ts +7 -7
- package/runtime/examples/extensions/working-message-test.ts +3 -3
- package/runtime/examples/sdk/01-minimal.ts +1 -1
- package/runtime/examples/sdk/03-custom-prompt.ts +1 -1
- package/runtime/examples/sdk/04-skills.ts +1 -1
- package/runtime/examples/sdk/05-tools.ts +1 -1
- package/runtime/examples/sdk/06-extensions.ts +11 -11
- package/runtime/examples/sdk/08-prompt-templates.ts +1 -1
- package/runtime/export-html/template.js +3 -3
- package/runtime/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/runtime/package.json +8 -14
- package/runtime/theme/dark.json +0 -1
- package/runtime/theme/light.json +0 -1
- package/runtime/theme/theme-schema.json +2 -2
- package/runtime/valni +2 -2
- package/runtime/README.md +0 -674
- package/runtime/docs/extensions.md +0 -2910
- package/runtime/docs/json.md +0 -82
- package/runtime/docs/models.md +0 -540
- package/runtime/docs/packages.md +0 -228
- package/runtime/docs/rpc.md +0 -1480
- package/runtime/docs/sdk.md +0 -1183
- package/runtime/docs/session-format.md +0 -422
- package/runtime/docs/settings.md +0 -315
- package/runtime/docs/shell-aliases.md +0 -13
- package/runtime/docs/terminal-setup.md +0 -142
- package/runtime/docs/termux.md +0 -127
- package/runtime/docs/tmux.md +0 -63
- package/runtime/docs/tui.md +0 -927
- package/runtime/docs/windows.md +0 -17
- package/runtime/examples/README.md +0 -25
- package/runtime/examples/extensions/README.md +0 -212
- package/runtime/examples/extensions/doom-overlay/README.md +0 -46
- package/runtime/examples/extensions/dynamic-resources/SKILL.md +0 -8
- package/runtime/examples/extensions/dynamic-resources/dynamic.md +0 -5
- package/runtime/examples/extensions/gondolin/index.ts +0 -531
- package/runtime/examples/extensions/gondolin/package-lock.json +0 -185
- package/runtime/examples/extensions/gondolin/package.json +0 -19
- package/runtime/examples/extensions/plan-mode/README.md +0 -66
- package/runtime/examples/extensions/subagent/README.md +0 -175
- package/runtime/examples/extensions/subagent/agents/planner.md +0 -37
- package/runtime/examples/extensions/subagent/agents/reviewer.md +0 -35
- package/runtime/examples/extensions/subagent/agents/scout.md +0 -50
- package/runtime/examples/extensions/subagent/agents/worker.md +0 -24
- package/runtime/examples/extensions/subagent/prompts/implement-and-review.md +0 -10
- package/runtime/examples/extensions/subagent/prompts/implement.md +0 -10
- package/runtime/examples/extensions/subagent/prompts/scout-and-plan.md +0 -9
- package/runtime/examples/sdk/README.md +0 -140
- package/runtime/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
- package/runtime/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
- package/runtime/node_modules/@mariozechner/clipboard/README.md +0 -60
- package/runtime/node_modules/@mariozechner/clipboard/build.rs +0 -5
- package/runtime/node_modules/@mariozechner/clipboard/clipboard.darwin-x64.node +0 -0
- package/runtime/node_modules/@mariozechner/clipboard/exp.ts +0 -12
- package/runtime/node_modules/@mariozechner/clipboard/index.js +0 -606
- package/runtime/node_modules/@mariozechner/clipboard/package.json +0 -56
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
- package/runtime/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
- package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/README.md +0 -3
- package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/clipboard.darwin-x64.node +0 -0
- package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/package.json +0 -22
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
#![deny(clippy::all)]
|
|
2
|
-
use base64::{engine::general_purpose, Engine as _};
|
|
3
|
-
#[allow(dead_code, unused_imports)]
|
|
4
|
-
mod clipboard_rs;
|
|
5
|
-
|
|
6
|
-
use clipboard_rs::{
|
|
7
|
-
common::RustImage, Clipboard, ClipboardContext, ClipboardHandler, ClipboardWatcher,
|
|
8
|
-
ClipboardWatcherContext, ContentFormat, RustImageData,
|
|
9
|
-
};
|
|
10
|
-
use napi::{
|
|
11
|
-
bindgen_prelude::*,
|
|
12
|
-
threadsafe_function::{ThreadsafeFunction, ThreadsafeFunctionCallMode},
|
|
13
|
-
};
|
|
14
|
-
use std::{sync::Arc, thread, time::Duration};
|
|
15
|
-
|
|
16
|
-
#[macro_use]
|
|
17
|
-
extern crate napi_derive;
|
|
18
|
-
|
|
19
|
-
fn napi_error(error: impl ToString) -> Error {
|
|
20
|
-
Error::from_reason(error.to_string())
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
#[napi]
|
|
24
|
-
pub fn available_formats() -> Result<Vec<String>> {
|
|
25
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
26
|
-
ctx.available_formats().map_err(napi_error)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#[napi]
|
|
30
|
-
pub async fn get_text() -> Result<String> {
|
|
31
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
32
|
-
ctx.get_text().map_err(napi_error)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#[napi]
|
|
36
|
-
pub async fn set_text(text: String) -> Result<()> {
|
|
37
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
38
|
-
ctx.set_text(text).map_err(napi_error)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
#[napi]
|
|
42
|
-
pub fn has_text() -> Result<bool> {
|
|
43
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
44
|
-
Ok(ctx.has(ContentFormat::Text))
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
#[napi]
|
|
48
|
-
pub async fn get_image_binary() -> Result<Vec<u8>> {
|
|
49
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
50
|
-
let image = ctx.get_image().map_err(napi_error)?;
|
|
51
|
-
let image_bytes = image.to_png().map_err(napi_error)?.get_bytes().to_vec();
|
|
52
|
-
Ok(image_bytes)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
#[napi]
|
|
56
|
-
pub async fn get_image_base64() -> Result<String> {
|
|
57
|
-
let image_bytes = get_image_binary().await?;
|
|
58
|
-
let base64_str = general_purpose::STANDARD_NO_PAD.encode(&image_bytes);
|
|
59
|
-
Ok(base64_str)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#[napi]
|
|
63
|
-
pub async fn set_image_binary(image_bytes: Vec<u8>) -> Result<()> {
|
|
64
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
65
|
-
let img = RustImageData::from_bytes(&image_bytes).map_err(napi_error)?;
|
|
66
|
-
ctx.set_image(img).map_err(napi_error)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#[napi]
|
|
70
|
-
pub async fn set_image_base64(base64_str: String) -> Result<()> {
|
|
71
|
-
let decoded: Vec<u8> = general_purpose::STANDARD_NO_PAD
|
|
72
|
-
.decode(base64_str)
|
|
73
|
-
.map_err(napi_error)?;
|
|
74
|
-
set_image_binary(decoded).await
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
#[napi]
|
|
78
|
-
pub fn has_image() -> Result<bool> {
|
|
79
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
80
|
-
Ok(ctx.has(ContentFormat::Image))
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
#[napi]
|
|
84
|
-
pub async fn get_html() -> Result<String> {
|
|
85
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
86
|
-
ctx.get_html().map_err(napi_error)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
#[napi]
|
|
90
|
-
pub async fn set_html(html: String) -> Result<()> {
|
|
91
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
92
|
-
ctx.set_html(html).map_err(napi_error)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
#[napi]
|
|
96
|
-
fn has_html() -> Result<bool> {
|
|
97
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
98
|
-
Ok(ctx.has(ContentFormat::Html))
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
#[napi]
|
|
102
|
-
pub async fn get_rtf() -> Result<String> {
|
|
103
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
104
|
-
ctx.get_rich_text().map_err(napi_error)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
#[napi]
|
|
108
|
-
pub async fn set_rtf(rtf: String) -> Result<()> {
|
|
109
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
110
|
-
ctx.set_rich_text(rtf).map_err(napi_error)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
#[napi]
|
|
114
|
-
pub fn has_rtf() -> Result<bool> {
|
|
115
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
116
|
-
Ok(ctx.has(ContentFormat::Rtf))
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
#[napi]
|
|
120
|
-
pub async fn clear() -> Result<()> {
|
|
121
|
-
let ctx = ClipboardContext::new().map_err(napi_error)?;
|
|
122
|
-
ctx.clear().map_err(napi_error)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
struct Manager {
|
|
126
|
-
ctx: ClipboardContext,
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
impl Manager {
|
|
130
|
-
pub fn new() -> Self {
|
|
131
|
-
let ctx = ClipboardContext::new().unwrap();
|
|
132
|
-
Manager { ctx }
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
impl ClipboardHandler for Manager {
|
|
137
|
-
fn on_clipboard_change(&mut self) {
|
|
138
|
-
println!(
|
|
139
|
-
"on_clipboard_change, txt = {}",
|
|
140
|
-
self.ctx.get_text().unwrap()
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
#[napi]
|
|
146
|
-
pub fn watch() {
|
|
147
|
-
let manager = Manager::new();
|
|
148
|
-
|
|
149
|
-
let mut watcher = ClipboardWatcherContext::new().unwrap();
|
|
150
|
-
|
|
151
|
-
let watcher_shutdown = watcher.add_handler(manager).get_shutdown_channel();
|
|
152
|
-
|
|
153
|
-
thread::spawn(move || {
|
|
154
|
-
thread::sleep(Duration::from_secs(5));
|
|
155
|
-
println!("stop watch!");
|
|
156
|
-
watcher_shutdown.stop();
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
println!("start watch!");
|
|
160
|
-
watcher.start_watch();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
#[napi]
|
|
164
|
-
pub fn call_threadsafe_function(callback: Arc<ThreadsafeFunction<u32, ()>>) -> Result<()> {
|
|
165
|
-
for n in 0..10 {
|
|
166
|
-
let tsfn = Arc::clone(&callback);
|
|
167
|
-
thread::spawn(move || {
|
|
168
|
-
tsfn.call(Ok(n), ThreadsafeFunctionCallMode::Blocking);
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
Ok(())
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// #[js_function(1)]
|
|
175
|
-
// fn hello(ctx: CallContext) -> Result<JsString, String> {
|
|
176
|
-
// let argument_one = ctx
|
|
177
|
-
// .get::<JsString>(0)
|
|
178
|
-
// .map_err(|err| err.to_string())?
|
|
179
|
-
// .into_utf8()
|
|
180
|
-
// .map_err(|err| err.to_string())?;
|
|
181
|
-
// ctx
|
|
182
|
-
// .env
|
|
183
|
-
// .create_string_from_std(format!("{} world!", argument_one.as_str()?))
|
|
184
|
-
// }
|
|
185
|
-
|
|
186
|
-
#[cfg(test)]
|
|
187
|
-
mod tests {
|
|
188
|
-
use super::*;
|
|
189
|
-
|
|
190
|
-
#[test]
|
|
191
|
-
fn it_works() {
|
|
192
|
-
watch();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
Binary file
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mariozechner/clipboard-darwin-x64",
|
|
3
|
-
"version": "0.3.9",
|
|
4
|
-
"os": [
|
|
5
|
-
"darwin"
|
|
6
|
-
],
|
|
7
|
-
"cpu": [
|
|
8
|
-
"x64"
|
|
9
|
-
],
|
|
10
|
-
"main": "clipboard.darwin-x64.node",
|
|
11
|
-
"files": [
|
|
12
|
-
"clipboard.darwin-x64.node"
|
|
13
|
-
],
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">= 10"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "https://github.com/badlogic/clipboard.git"
|
|
21
|
-
}
|
|
22
|
-
}
|