@xuanwo/xurl 0.0.17 → 0.0.18-darwin-arm64

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/README.md CHANGED
@@ -26,6 +26,18 @@ npx skills add Xuanwo/xurl
26
26
  Please summarize this thread: agents://codex/xxx_thread
27
27
  ```
28
28
 
29
+
30
+ ## Providers
31
+
32
+ | Provider | Query | Create |
33
+ | --- | --- | --- |
34
+ | <img src="https://ampcode.com/amp-mark-color.svg" alt="Amp logo" width="16" height="16" /> Amp | Yes | Yes |
35
+ | <img src="https://avatars.githubusercontent.com/u/14957082?s=24&v=4" alt="Codex logo" width="16" height="16" /> Codex | Yes | Yes |
36
+ | <img src="https://www.anthropic.com/favicon.ico" alt="Claude logo" width="16" height="16" /> Claude | Yes | Yes |
37
+ | <img src="https://www.google.com/favicon.ico" alt="Gemini logo" width="16" height="16" /> Gemini | Yes | Yes |
38
+ | <img src=".github/assets/pi-logo-dark.svg" alt="Pi logo" width="16" height="16" /> Pi | Yes | Yes |
39
+ | <img src="https://opencode.ai/favicon.ico" alt="OpenCode logo" width="16" height="16" /> OpenCode | Yes | Yes |
40
+
29
41
  ## Usage
30
42
 
31
43
  Read an agent conversation:
@@ -54,7 +66,6 @@ Drill down into a discovered child target:
54
66
  xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592/019c87fb-38b9-7843-92b1-832f02598495
55
67
  ```
56
68
 
57
- OpenCode child linkage is validated via sqlite `session.parent_id`.
58
69
  Start a new agent conversation:
59
70
 
60
71
  ```bash
@@ -67,6 +78,12 @@ Continue an existing conversation:
67
78
  xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592 -d "Continue"
68
79
  ```
69
80
 
81
+ Create with query parameters:
82
+
83
+ ```bash
84
+ xurl "agents://codex?workdir=%2FUsers%2Falice%2Frepo&add_dir=%2FUsers%2Falice%2Fshared&model=gpt-5" -d "Review this patch"
85
+ ```
86
+
70
87
  Save output:
71
88
 
72
89
  ```bash
@@ -79,44 +96,40 @@ xurl -o /tmp/conversation.md agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
79
96
  xurl [OPTIONS] <URI>
80
97
  ```
81
98
 
82
- Options:
83
-
84
99
  - `-I, --head`: output frontmatter/discovery info only.
85
100
  - `-d, --data <DATA>`: write payload (repeatable).
101
+ - text: `-d "hello"`
102
+ - file: `-d @prompt.txt`
103
+ - stdin: `-d @-`
86
104
  - `-o, --output <PATH>`: write command output to file.
87
105
 
88
- Collection query parameters (for `agents://<provider>` read mode):
89
-
90
- - `q=<keyword>`: keyword search in provider thread data.
91
- - `limit=<n>`: result count, default is `10`.
106
+ ## URI Reference
92
107
 
93
- `--data` supports:
94
-
95
- - text: `-d "hello"`
96
- - file: `-d @prompt.txt`
97
- - stdin: `-d @-`
108
+ ```text
109
+ agents://<provider>[/<conversation_id>[/<child_id>]][?<query>]
110
+ |------| |--------| |---------------------------| |------|
111
+ scheme provider optional path parts query
112
+ ```
98
113
 
99
- ## Providers
114
+ - `scheme`: fixed as `agents`.
115
+ - `provider`: target provider name, such as `codex`, `claude`, `gemini`, `amp`, `pi`, `opencode`.
116
+ - `conversation_id`: main conversation identifier.
117
+ - `child_id`: child/subagent identifier under a main conversation.
118
+ - `query`: optional key-value parameters, interpreted by context.
100
119
 
101
- | Provider | Query | Create |
102
- | --- | --- | --- |
103
- | <img src="https://ampcode.com/amp-mark-color.svg" alt="Amp logo" width="16" height="16" /> Amp | Yes | Yes |
104
- | <img src="https://avatars.githubusercontent.com/u/14957082?s=24&v=4" alt="Codex logo" width="16" height="16" /> Codex | Yes | Yes |
105
- | <img src="https://www.anthropic.com/favicon.ico" alt="Claude logo" width="16" height="16" /> Claude | Yes | Yes |
106
- | <img src="https://www.google.com/favicon.ico" alt="Gemini logo" width="16" height="16" /> Gemini | Yes | Yes |
107
- | <img src=".github/assets/pi-logo-dark.svg" alt="Pi logo" width="16" height="16" /> Pi | Yes | Yes |
108
- | <img src="https://opencode.ai/favicon.ico" alt="OpenCode logo" width="16" height="16" /> OpenCode | Yes | Yes |
109
120
 
110
- ## URI Formats
121
+ ### Query
111
122
 
112
- ```text
113
- agents://<provider>[?q=<keyword>&limit=<n>]
114
- agents://<provider>/<conversation_target>
115
- ```
123
+ - `q=<keyword>`: filters discovery results by keyword. Use when you want to find conversations by topic.
124
+ - `limit=<n>`: limits discovery result count (default `10`). Use when you need a shorter or longer result list.
125
+ - `workdir=<dir>`: sets the initial working directory for create mode. Use when a new conversation should run in a specific project root.
126
+ - `add_dir=<dir>`: adds additional directories for create mode (repeatable). Use when a new conversation needs access to multiple directories.
127
+ - `<key>=<value>`: passes a custom provider option in create mode. Use when you need provider-specific behavior not covered by standard keys.
116
128
 
117
- For examples:
129
+ Examples:
118
130
 
119
131
  ```text
120
132
  agents://codex?q=spawn_agent&limit=10
121
133
  agents://codex/threads/<conversation_id>
134
+ agents://codex?workdir=%2FUsers%2Falice%2Frepo
122
135
  ```
package/package.json CHANGED
@@ -1,27 +1,21 @@
1
1
  {
2
2
  "name": "@xuanwo/xurl",
3
- "version": "0.0.17",
3
+ "version": "0.0.18-darwin-arm64",
4
4
  "license": "Apache-2.0",
5
- "bin": {
6
- "xurl": "bin/xurl.js"
7
- },
8
- "type": "module",
9
- "engines": {
10
- "node": ">=16"
11
- },
5
+ "os": [
6
+ "darwin"
7
+ ],
8
+ "cpu": [
9
+ "arm64"
10
+ ],
12
11
  "files": [
13
- "bin"
12
+ "vendor"
14
13
  ],
15
14
  "repository": {
16
15
  "type": "git",
17
16
  "url": "git+https://github.com/Xuanwo/xurl.git"
18
17
  },
19
- "optionalDependencies": {
20
- "@xuanwo/xurl-linux-x64": "npm:@xuanwo/xurl@0.0.17-linux-x64",
21
- "@xuanwo/xurl-linux-arm64": "npm:@xuanwo/xurl@0.0.17-linux-arm64",
22
- "@xuanwo/xurl-darwin-x64": "npm:@xuanwo/xurl@0.0.17-darwin-x64",
23
- "@xuanwo/xurl-darwin-arm64": "npm:@xuanwo/xurl@0.0.17-darwin-arm64",
24
- "@xuanwo/xurl-win32-x64": "npm:@xuanwo/xurl@0.0.17-win32-x64",
25
- "@xuanwo/xurl-win32-arm64": "npm:@xuanwo/xurl@0.0.17-win32-arm64"
18
+ "engines": {
19
+ "node": ">=16"
26
20
  }
27
21
  }
package/bin/xurl.js DELETED
@@ -1,141 +0,0 @@
1
- #!/usr/bin/env node
2
- // Unified entry point for the xurl CLI.
3
-
4
- import { spawn } from "node:child_process";
5
- import { existsSync } from "node:fs";
6
- import { createRequire } from "node:module";
7
- import path from "node:path";
8
- import { fileURLToPath } from "node:url";
9
-
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = path.dirname(__filename);
12
- const require = createRequire(import.meta.url);
13
-
14
- const PLATFORM_PACKAGE_BY_TARGET = {
15
- "x86_64-unknown-linux-gnu": "@xuanwo/xurl-linux-x64",
16
- "aarch64-unknown-linux-gnu": "@xuanwo/xurl-linux-arm64",
17
- "x86_64-apple-darwin": "@xuanwo/xurl-darwin-x64",
18
- "aarch64-apple-darwin": "@xuanwo/xurl-darwin-arm64",
19
- "x86_64-pc-windows-msvc": "@xuanwo/xurl-win32-x64",
20
- "aarch64-pc-windows-msvc": "@xuanwo/xurl-win32-arm64",
21
- };
22
-
23
- function detectTargetTriple(platformName, archName) {
24
- switch (platformName) {
25
- case "linux":
26
- if (archName === "x64") {
27
- return "x86_64-unknown-linux-gnu";
28
- }
29
- if (archName === "arm64") {
30
- return "aarch64-unknown-linux-gnu";
31
- }
32
- break;
33
- case "darwin":
34
- if (archName === "x64") {
35
- return "x86_64-apple-darwin";
36
- }
37
- if (archName === "arm64") {
38
- return "aarch64-apple-darwin";
39
- }
40
- break;
41
- case "win32":
42
- if (archName === "x64") {
43
- return "x86_64-pc-windows-msvc";
44
- }
45
- if (archName === "arm64") {
46
- return "aarch64-pc-windows-msvc";
47
- }
48
- break;
49
- default:
50
- break;
51
- }
52
- return null;
53
- }
54
-
55
- function detectPackageManager() {
56
- const userAgent = process.env.npm_config_user_agent || "";
57
- if (/\bbun\//.test(userAgent)) {
58
- return "bun";
59
- }
60
- return userAgent ? "npm" : null;
61
- }
62
-
63
- const targetTriple = detectTargetTriple(process.platform, process.arch);
64
- if (!targetTriple) {
65
- throw new Error(`Unsupported platform: ${process.platform} (${process.arch})`);
66
- }
67
-
68
- const platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
69
- if (!platformPackage) {
70
- throw new Error(`Unsupported target triple: ${targetTriple}`);
71
- }
72
-
73
- const binaryName = process.platform === "win32" ? "xurl.exe" : "xurl";
74
- const localVendorRoot = path.join(__dirname, "..", "vendor");
75
- const localBinaryPath = path.join(localVendorRoot, targetTriple, "xurl", binaryName);
76
-
77
- let vendorRoot;
78
- try {
79
- const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
80
- vendorRoot = path.join(path.dirname(packageJsonPath), "vendor");
81
- } catch {
82
- if (existsSync(localBinaryPath)) {
83
- vendorRoot = localVendorRoot;
84
- } else {
85
- const manager = detectPackageManager();
86
- const updateCommand =
87
- manager === "bun"
88
- ? "bun install -g @xuanwo/xurl@latest"
89
- : "npm install -g @xuanwo/xurl@latest";
90
- throw new Error(
91
- `Missing optional dependency ${platformPackage}. Reinstall xurl: ${updateCommand}`,
92
- );
93
- }
94
- }
95
-
96
- const binaryPath = path.join(vendorRoot, targetTriple, "xurl", binaryName);
97
- const env = { ...process.env };
98
- env[detectPackageManager() === "bun" ? "XURL_MANAGED_BY_BUN" : "XURL_MANAGED_BY_NPM"] =
99
- "1";
100
-
101
- const child = spawn(binaryPath, process.argv.slice(2), {
102
- stdio: "inherit",
103
- env,
104
- });
105
-
106
- child.on("error", (err) => {
107
- // eslint-disable-next-line no-console
108
- console.error(err);
109
- process.exit(1);
110
- });
111
-
112
- const forwardSignal = (signal) => {
113
- if (child.killed) {
114
- return;
115
- }
116
- try {
117
- child.kill(signal);
118
- } catch {
119
- // Ignore errors when the child already exited.
120
- }
121
- };
122
-
123
- ["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
124
- process.on(signal, () => forwardSignal(signal));
125
- });
126
-
127
- const childResult = await new Promise((resolve) => {
128
- child.on("exit", (code, signal) => {
129
- if (signal) {
130
- resolve({ type: "signal", signal });
131
- } else {
132
- resolve({ type: "code", exitCode: code ?? 1 });
133
- }
134
- });
135
- });
136
-
137
- if (childResult.type === "signal") {
138
- process.kill(process.pid, childResult.signal);
139
- } else {
140
- process.exit(childResult.exitCode);
141
- }