@valni/cli-darwin-x64 0.1.2 → 0.1.4
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,140 +0,0 @@
|
|
|
1
|
-
# SDK Examples
|
|
2
|
-
|
|
3
|
-
Programmatic usage of pi-coding-agent via `createAgentSession()` and `createAgentSessionRuntime()`.
|
|
4
|
-
|
|
5
|
-
The runtime example shows how to build a recreate function that closes over process-global fixed inputs and recreates cwd-bound services and sessions as the active session cwd changes.
|
|
6
|
-
|
|
7
|
-
## Examples
|
|
8
|
-
|
|
9
|
-
| File | Description |
|
|
10
|
-
|------|-------------|
|
|
11
|
-
| `01-minimal.ts` | Simplest usage with all defaults |
|
|
12
|
-
| `02-custom-model.ts` | Select model and thinking level |
|
|
13
|
-
| `03-custom-prompt.ts` | Replace or modify system prompt |
|
|
14
|
-
| `04-skills.ts` | Discover, filter, or replace skills |
|
|
15
|
-
| `05-tools.ts` | Built-in tool allowlists |
|
|
16
|
-
| `06-extensions.ts` | Logging, blocking, result modification |
|
|
17
|
-
| `07-context-files.ts` | AGENTS.md context files |
|
|
18
|
-
| `08-slash-commands.ts` | File-based slash commands |
|
|
19
|
-
| `09-api-keys-and-oauth.ts` | API key resolution, OAuth config |
|
|
20
|
-
| `10-settings.ts` | Override compaction, retry, terminal settings |
|
|
21
|
-
| `11-sessions.ts` | In-memory, persistent, continue, list sessions |
|
|
22
|
-
| `12-full-control.ts` | Replace everything, no discovery |
|
|
23
|
-
| `13-session-runtime.ts` | Manage runtime-backed session replacement |
|
|
24
|
-
|
|
25
|
-
## Running
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
cd packages/coding-agent
|
|
29
|
-
npx tsx examples/sdk/01-minimal.ts
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Quick Reference
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import { getModel } from "@valni/ai";
|
|
36
|
-
import {
|
|
37
|
-
createAgentSession,
|
|
38
|
-
DefaultResourceLoader,
|
|
39
|
-
ModelRuntime,
|
|
40
|
-
SessionManager,
|
|
41
|
-
SettingsManager,
|
|
42
|
-
} from "@valni/cli";
|
|
43
|
-
|
|
44
|
-
const modelRuntime = await ModelRuntime.create();
|
|
45
|
-
|
|
46
|
-
// Minimal
|
|
47
|
-
const { session } = await createAgentSession({ modelRuntime });
|
|
48
|
-
|
|
49
|
-
// Custom model
|
|
50
|
-
const model = getModel("anthropic", "claude-opus-4-5");
|
|
51
|
-
const { session } = await createAgentSession({ model, thinkingLevel: "high", modelRuntime });
|
|
52
|
-
|
|
53
|
-
// Modify prompt
|
|
54
|
-
const loader = new DefaultResourceLoader({
|
|
55
|
-
systemPromptOverride: (base) => `${base}\n\nBe concise.`,
|
|
56
|
-
});
|
|
57
|
-
await loader.reload();
|
|
58
|
-
const { session } = await createAgentSession({ resourceLoader: loader, modelRuntime });
|
|
59
|
-
|
|
60
|
-
// Read-only
|
|
61
|
-
const { session } = await createAgentSession({ tools: ["read", "grep", "find", "ls"], modelRuntime });
|
|
62
|
-
|
|
63
|
-
// In-memory
|
|
64
|
-
const { session } = await createAgentSession({
|
|
65
|
-
sessionManager: SessionManager.inMemory(),
|
|
66
|
-
modelRuntime,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// Full control
|
|
70
|
-
const customRuntime = await ModelRuntime.create({
|
|
71
|
-
authPath: "/my/app/auth.json",
|
|
72
|
-
modelsPath: "/my/app/models.json",
|
|
73
|
-
});
|
|
74
|
-
customRuntime.setRuntimeApiKey("anthropic", process.env.MY_KEY!);
|
|
75
|
-
|
|
76
|
-
const resourceLoader = new DefaultResourceLoader({
|
|
77
|
-
systemPromptOverride: () => "You are helpful.",
|
|
78
|
-
extensionFactories: [myExtension],
|
|
79
|
-
skillsOverride: () => ({ skills: [], diagnostics: [] }),
|
|
80
|
-
agentsFilesOverride: () => ({ agentsFiles: [] }),
|
|
81
|
-
promptsOverride: () => ({ prompts: [], diagnostics: [] }),
|
|
82
|
-
});
|
|
83
|
-
await resourceLoader.reload();
|
|
84
|
-
|
|
85
|
-
const { session } = await createAgentSession({
|
|
86
|
-
model,
|
|
87
|
-
modelRuntime: customRuntime,
|
|
88
|
-
resourceLoader,
|
|
89
|
-
tools: ["read", "bash", "my_tool"],
|
|
90
|
-
customTools: [myTool],
|
|
91
|
-
sessionManager: SessionManager.inMemory(),
|
|
92
|
-
settingsManager: SettingsManager.inMemory(),
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// Run prompts
|
|
96
|
-
session.subscribe((event) => {
|
|
97
|
-
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
|
|
98
|
-
process.stdout.write(event.assistantMessageEvent.delta);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
await session.prompt("Hello");
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Options
|
|
105
|
-
|
|
106
|
-
| Option | Default | Description |
|
|
107
|
-
|--------|---------|-------------|
|
|
108
|
-
| `modelRuntime` | Runtime using `agentDir/auth.json` and `models.json` | Canonical model and authentication runtime |
|
|
109
|
-
| `cwd` | `process.cwd()` | Working directory |
|
|
110
|
-
| `agentDir` | `~/.valni/agent` | Config directory |
|
|
111
|
-
| `model` | From settings/first available | Model to use |
|
|
112
|
-
| `thinkingLevel` | From settings/"off" | off, low, medium, high |
|
|
113
|
-
| `tools` | `["read", "bash", "edit", "write"]` built-ins | Allowlist tool names across built-in, extension, and custom tools |
|
|
114
|
-
| `customTools` | `[]` | Additional tool definitions |
|
|
115
|
-
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes, and context files |
|
|
116
|
-
| `sessionManager` | `SessionManager.create(cwd)` | Persistence |
|
|
117
|
-
| `settingsManager` | `SettingsManager.create(cwd, agentDir)` | Settings overrides |
|
|
118
|
-
|
|
119
|
-
## Events
|
|
120
|
-
|
|
121
|
-
```typescript
|
|
122
|
-
session.subscribe((event) => {
|
|
123
|
-
switch (event.type) {
|
|
124
|
-
case "message_update":
|
|
125
|
-
if (event.assistantMessageEvent.type === "text_delta") {
|
|
126
|
-
process.stdout.write(event.assistantMessageEvent.delta);
|
|
127
|
-
}
|
|
128
|
-
break;
|
|
129
|
-
case "tool_execution_start":
|
|
130
|
-
console.log(`Tool: ${event.toolName}`);
|
|
131
|
-
break;
|
|
132
|
-
case "tool_execution_end":
|
|
133
|
-
console.log(`Result: ${event.result}`);
|
|
134
|
-
break;
|
|
135
|
-
case "agent_end":
|
|
136
|
-
console.log("Done");
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
edition = "2021"
|
|
3
|
-
name = "crosscopy_clipboard"
|
|
4
|
-
version = "0.0.0"
|
|
5
|
-
|
|
6
|
-
[lib]
|
|
7
|
-
crate-type = ["cdylib"]
|
|
8
|
-
|
|
9
|
-
[features]
|
|
10
|
-
default = ["image"]
|
|
11
|
-
image = ["dep:image"]
|
|
12
|
-
wayland = ["dep:wl-clipboard-rs"]
|
|
13
|
-
|
|
14
|
-
[dependencies]
|
|
15
|
-
base64 = "0.22.0"
|
|
16
|
-
futures = "0.3.30"
|
|
17
|
-
# Pin image to version compatible with older Rust in CI Docker images
|
|
18
|
-
image = { version = "=0.25.5", features = ["png", "jpeg"], optional = true, default-features = false }
|
|
19
|
-
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
|
|
20
|
-
napi = { version = "3.9.0", default-features = false, features = ["napi4", "tokio_rt", "dyn-symbols"] }
|
|
21
|
-
napi-derive = "3.5.6"
|
|
22
|
-
tokio = "1.36.0"
|
|
23
|
-
|
|
24
|
-
[target.'cfg(all(unix, not(any(target_os="macos", target_os="android", target_os="ios", target_os="emscripten"))))'.dependencies]
|
|
25
|
-
wl-clipboard-rs = { version = "0.9", optional = true }
|
|
26
|
-
x11rb = { version = "0.13.2", features = ["xfixes"] }
|
|
27
|
-
|
|
28
|
-
[target.'cfg(target_os = "macos")'.dependencies]
|
|
29
|
-
image = { version = "=0.25.5", features = ["tiff", "png", "jpeg"], optional = true, default-features = false }
|
|
30
|
-
objc2 = "0.6.3"
|
|
31
|
-
objc2-app-kit = { version = "0.3.2", features = ["NSPasteboard", "NSPasteboardItem", "NSImage"] }
|
|
32
|
-
objc2-foundation = { version = "0.3.2", features = ["NSArray", "NSString", "NSEnumerator"] }
|
|
33
|
-
|
|
34
|
-
[target.'cfg(target_os = "windows")'.dependencies]
|
|
35
|
-
clipboard-win = { version = "5.4.1", features = ["monitor"] }
|
|
36
|
-
image = { version = "=0.25.5", features = ["bmp", "png", "jpeg"], optional = true, default-features = false }
|
|
37
|
-
windows = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Graphics_Gdi", "Win32_System_DataExchange"] }
|
|
38
|
-
|
|
39
|
-
[build-dependencies]
|
|
40
|
-
# Pin to version that works with older Rust in Docker images
|
|
41
|
-
napi-build = "2.3.2"
|
|
42
|
-
|
|
43
|
-
[profile.release]
|
|
44
|
-
lto = true
|
|
45
|
-
strip = "symbols"
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# @mariozechner/clipboard
|
|
2
|
-
|
|
3
|
-
> **Fork of [@crosscopy/clipboard](https://github.com/CrossCopy/clipboard)**
|
|
4
|
-
>
|
|
5
|
-
> This fork updates to the latest `clipboard-rs` (0.3.1) and adds musl (Alpine Linux) support.
|
|
6
|
-
> All credit goes to the original authors.
|
|
7
|
-
|
|
8
|
-

|
|
9
|
-
[](https://github.com/badlogic/clipboard/actions/workflows/CI.yml)
|
|
10
|
-
|
|
11
|
-
**NPM Package**: https://www.npmjs.com/package/@mariozechner/clipboard
|
|
12
|
-
|
|
13
|
-
**GitHub**: https://github.com/badlogic/clipboard
|
|
14
|
-
|
|
15
|
-
> This is a clipboard API npm package that allows you to copy and paste data to and from the clipboard.
|
|
16
|
-
> There doesn't seem to be a good clipboard package for node.js (that supports data format beyond text), so I decided to make one.
|
|
17
|
-
> Data Format Supported
|
|
18
|
-
>
|
|
19
|
-
> - Text
|
|
20
|
-
> - Image
|
|
21
|
-
> - Rich Text Format
|
|
22
|
-
> - Files
|
|
23
|
-
> - HTML
|
|
24
|
-
|
|
25
|
-
## Acknowledgements
|
|
26
|
-
|
|
27
|
-
- [ChurchTao/clipboard-rs](https://github.com/ChurchTao/clipboard-rs) is written in rust, which is used to provide the native clipboard support for this package across Linux, Windows and MacOS. This package is basically a wrapper around this rust package.
|
|
28
|
-
- https://crates.io/crates/clipboard-rs
|
|
29
|
-
- [napi.rs](https://napi.rs/) was used to create the node.js addon for this package, so that API calls written in rust can be called from node.js.
|
|
30
|
-
|
|
31
|
-
## API
|
|
32
|
-
|
|
33
|
-
Detailed API function declarations can be found in the [index.d.ts](./index.d.ts).
|
|
34
|
-
|
|
35
|
-
Or you can refer to the source code in [src/lib.rs](./src/lib.rs).
|
|
36
|
-
|
|
37
|
-
## Sample
|
|
38
|
-
|
|
39
|
-
```javascript
|
|
40
|
-
import Clipboard from "@mariozechner/clipboard";
|
|
41
|
-
|
|
42
|
-
console.log(await Clipboard.getText());
|
|
43
|
-
|
|
44
|
-
console.log(await Clipboard.getHtml());
|
|
45
|
-
|
|
46
|
-
if (await Clipboard.hasImage()) {
|
|
47
|
-
console.log(await Clipboard.getImageBase64());
|
|
48
|
-
} else {
|
|
49
|
-
console.log("No Image");
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Publish
|
|
54
|
-
|
|
55
|
-
Everything is done with GitHub Action.
|
|
56
|
-
|
|
57
|
-
Run `npm version patch` to bump the version.
|
|
58
|
-
Then `git push --follow-tags` to push the changes and tags to GitHub. GitHub Action will automatically build and publish.
|
|
59
|
-
|
|
60
|
-
The GitHub Actions `NPM_TOKEN` repository secret is a granular npm token with publish access to `@mariozechner/clipboard` and all `@mariozechner/clipboard-*` platform packages. npm granular access tokens expire after 90 days, so this secret must be rotated before expiry.
|
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Clipboard from "./index.js";
|
|
2
|
-
|
|
3
|
-
console.log(await Clipboard.getText());
|
|
4
|
-
|
|
5
|
-
console.log(await Clipboard.getHtml());
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (await Clipboard.hasImage()) {
|
|
9
|
-
console.log(await Clipboard.getImageBase64());
|
|
10
|
-
} else {
|
|
11
|
-
console.log("No Image");
|
|
12
|
-
}
|