@xuanwo/xurl 0.0.15 → 0.0.16-darwin-x64

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
@@ -4,46 +4,12 @@
4
4
 
5
5
  > Also known as **Xuanwo's URL**.
6
6
 
7
- ## Features
8
-
9
- - Multi-agent thread resolution:
10
- - <img src="https://ampcode.com/amp-mark-color.svg" alt="Amp logo" width="16" height="16" /> Amp
11
- - <img src="https://avatars.githubusercontent.com/u/14957082?s=24&v=4" alt="Codex logo" width="16" height="16" /> Codex
12
- - <img src="https://www.anthropic.com/favicon.ico" alt="Claude logo" width="16" height="16" /> Claude
13
- - <img src="https://www.google.com/favicon.ico" alt="Gemini logo" width="16" height="16" /> Gemini
14
- - <img src=".github/assets/pi-logo-dark.svg" alt="Pi logo" width="16" height="16" /> Pi
15
- - <img src="https://opencode.ai/favicon.ico" alt="OpenCode logo" width="16" height="16" /> OpenCode
16
- - Unified URI scheme: `agents://<provider>/<thread_path>` is the primary format.
17
- - Default output is markdown with YAML frontmatter header plus provider-specific body.
18
- - `-I, --head` outputs frontmatter only.
19
- - `-o, --output <path>` writes rendered output to a file.
20
- - For Codex/Claude/Pi main URIs, head output includes discovery fields (`subagents` / `entries`) that replace list-mode aggregation.
21
- - Subagent markdown views print full parent/subagent URIs in `agents://...` format.
22
- - Non-fatal diagnostics are kept internal; only fatal errors are printed to `stderr`.
23
- - Automatically respects official environment variables and default local data roots for each supported agent.
24
-
25
- ## Install
26
-
27
- Homebrew:
7
+ ## What xURL Can Do
28
8
 
29
- ```bash
30
- brew tap xuanwo/tap
31
- brew install xurl
32
- ```
33
-
34
- PyPI via `uv`:
35
-
36
- ```bash
37
- uv tool install xuanwo-xurl
38
- xurl --version
39
- ```
40
-
41
- npm:
42
-
43
- ```bash
44
- npm install -g @xuanwo/xurl
45
- xurl --version
46
- ```
9
+ - Read an agent conversation as markdown.
10
+ - Discover subagent/branch navigation targets.
11
+ - Start a new conversation with agents.
12
+ - Continue an existing conversation with follow-up prompts.
47
13
 
48
14
  ## Quick Start
49
15
 
@@ -59,162 +25,82 @@ npx skills add Xuanwo/xurl
59
25
  Please summarize this thread: agents://codex/xxx_thread
60
26
  ```
61
27
 
62
- ## Repository Usage
28
+ ## Usage
63
29
 
64
- Run `xurl` directly from source:
30
+ Read an agent conversation:
65
31
 
66
32
  ```bash
67
- cargo run -p xurl-cli -- --help
33
+ xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
68
34
  ```
69
35
 
70
- Run the test suite:
36
+ Discover child targets:
71
37
 
72
38
  ```bash
73
- cargo test --workspace
39
+ xurl -I agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
74
40
  ```
75
41
 
76
- Run CLI integration tests only:
42
+ Drill down into a discovered child target:
77
43
 
78
44
  ```bash
79
- cargo test -p xurl-cli --test cli
80
- ```
81
-
82
- Release process summary:
83
-
84
- 1. Bump crate versions in `xurl-core/Cargo.toml` and `xurl-cli/Cargo.toml`.
85
- 2. Push to `main`.
86
- 3. Create and push a tag like `v0.0.14`.
87
- 4. GitHub Actions will publish release assets, npm, PyPI, and Homebrew updates.
88
-
89
- ## Projects in This Repository
90
-
91
- - [`xurl-core`](./xurl-core): core URI parsing, provider resolution, thread reading, and markdown rendering.
92
- - [`xurl-cli`](./xurl-cli): CLI entrypoint and argument handling for `xurl`.
93
- - [`npm`](./npm): Node.js wrapper package source for [`@xuanwo/xurl`](https://www.npmjs.com/package/@xuanwo/xurl).
94
- - [`pyproject.toml`](./pyproject.toml): Python package metadata for [`xuanwo-xurl`](https://pypi.org/project/xuanwo-xurl/).
95
- - [`homebrew-tap`](https://github.com/Xuanwo/homebrew-tap): Homebrew formula repository (`xuanwo/tap`).
96
- - [`skills/xurl`](./skills/xurl/SKILL.md): Codex skill instructions for using `xurl`.
97
-
98
- ## URL Format
99
-
100
- Primary URI format:
101
-
102
- ```text
103
- agents://<provider>/<thread_path>
45
+ xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592/019c87fb-38b9-7843-92b1-832f02598495
104
46
  ```
105
47
 
106
- ASCII breakdown:
48
+ OpenCode child linkage is validated via sqlite `session.parent_id`.
49
+ Start a new agent conversation:
107
50
 
108
- ```text
109
- agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592/019c87fb-38b9-7843-92b1-832f02598495
110
- ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111
- scheme provider thread_path (provider-specific: main thread, optional child thread)
51
+ ```bash
52
+ xurl agents://codex -d "Draft a migration plan"
112
53
  ```
113
54
 
114
- ## Agents
115
-
116
- ### Amp
117
-
118
- - Supported URIs:
119
- - `agents://amp/<thread_id>`
120
- - Thread id format:
121
- - `T-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
122
- - Resolution:
123
- - `XDG_DATA_HOME/amp/threads/<thread_id>.json`
124
- - fallback: `~/.local/share/amp/threads/<thread_id>.json`
125
- - Example:
55
+ Continue an existing conversation:
126
56
 
127
57
  ```bash
128
- xurl agents://amp/T-019c0797-c402-7389-bd80-d785c98df295
58
+ xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592 -d "Continue"
129
59
  ```
130
60
 
131
- ### Codex
132
-
133
- - Supported URIs:
134
- - `agents://codex/<session_id>`
135
- - `agents://codex/threads/<session_id>`
136
- - `agents://codex/<main_session_id>/<agent_id>`
137
- - Subagent modes:
138
- - Aggregate header only: `xurl -I agents://codex/<main_session_id>`
139
- - Drill-down: `xurl agents://codex/<main_session_id>/<agent_id>`
140
- - Resolution order:
141
- - SQLite thread index under `CODEX_HOME` (`state_<version>.sqlite` first, then `state.sqlite`) via `threads(id, rollout_path, archived)`.
142
- - Filesystem fallback under `sessions/` and `archived_sessions/` for `rollout-*.jsonl`.
143
- - Examples:
61
+ Save output:
144
62
 
145
63
  ```bash
146
- xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
147
- xurl agents://codex/threads/019c871c-b1f9-7f60-9c4f-87ed09f13592
148
- xurl -o /tmp/codex-thread.md agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
149
- xurl -I agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
150
- xurl agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592/019c87fb-38b9-7843-92b1-832f02598495
64
+ xurl -o /tmp/conversation.md agents://codex/019c871c-b1f9-7f60-9c4f-87ed09f13592
151
65
  ```
152
66
 
153
- ### Claude
154
-
155
- - Supported URIs:
156
- - `agents://claude/<session_id>`
157
- - `agents://claude/<main_session_id>/<agent_id>`
158
- - Subagent modes:
159
- - Aggregate header only: `xurl -I agents://claude/<main_session_id>`
160
- - Drill-down: `xurl agents://claude/<main_session_id>/<agent_id>`
161
- - Example:
67
+ ## Command Reference
162
68
 
163
69
  ```bash
164
- xurl agents://claude/2823d1df-720a-4c31-ac55-ae8ba726721f
165
- xurl -I agents://claude/2823d1df-720a-4c31-ac55-ae8ba726721f
166
- xurl agents://claude/2823d1df-720a-4c31-ac55-ae8ba726721f/acompact-69d537
70
+ xurl [OPTIONS] <URI>
167
71
  ```
168
72
 
169
- ### OpenCode
73
+ Options:
170
74
 
171
- - Supported URIs:
172
- - `agents://opencode/<session_id>`
173
- - Example:
75
+ - `-I, --head`: output frontmatter/discovery info only.
76
+ - `-d, --data <DATA>`: write payload (repeatable).
77
+ - `-o, --output <PATH>`: write command output to file.
174
78
 
175
- ```bash
176
- xurl agents://opencode/ses_43a90e3adffejRgrTdlJa48CtE
177
- ```
79
+ `--data` supports:
178
80
 
179
- ### Gemini
81
+ - text: `-d "hello"`
82
+ - file: `-d @prompt.txt`
83
+ - stdin: `-d @-`
180
84
 
181
- - Supported URI:
182
- - `agents://gemini/<session_id>`
183
- - Session id format:
184
- - `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
185
- - Resolution:
186
- - `GEMINI_CLI_HOME/.gemini/tmp/*/chats/session-*.json`
187
- - fallback: `~/.gemini/tmp/*/chats/session-*.json`
188
- - Example:
85
+ ## Providers
189
86
 
190
- ```bash
191
- xurl agents://gemini/29d207db-ca7e-40ba-87f7-e14c9de60613
192
- ```
87
+ | Provider | Query | Create |
88
+ | --- | --- | --- |
89
+ | <img src="https://ampcode.com/amp-mark-color.svg" alt="Amp logo" width="16" height="16" /> Amp | Yes | Yes |
90
+ | <img src="https://avatars.githubusercontent.com/u/14957082?s=24&v=4" alt="Codex logo" width="16" height="16" /> Codex | Yes | Yes |
91
+ | <img src="https://www.anthropic.com/favicon.ico" alt="Claude logo" width="16" height="16" /> Claude | Yes | Yes |
92
+ | <img src="https://www.google.com/favicon.ico" alt="Gemini logo" width="16" height="16" /> Gemini | Yes | Yes |
93
+ | <img src=".github/assets/pi-logo-dark.svg" alt="Pi logo" width="16" height="16" /> Pi | Yes | Yes |
94
+ | <img src="https://opencode.ai/favicon.ico" alt="OpenCode logo" width="16" height="16" /> OpenCode | Yes | Yes |
193
95
 
194
- ### Pi
195
-
196
- - Supported URIs:
197
- - `agents://pi/<session_id>`
198
- - `agents://pi/<session_id>/<entry_id>`
199
- - Session id format:
200
- - `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
201
- - Resolution:
202
- - `PI_CODING_AGENT_DIR/sessions/**/*.jsonl`
203
- - fallback: `~/.pi/agent/sessions/**/*.jsonl`
204
- - Rendering:
205
- - `agents://pi/<session_id>` renders the latest leaf branch in the session tree.
206
- - `agents://pi/<session_id>/<entry_id>` renders the branch ending at the specified entry id.
207
- - `xurl -I agents://pi/<session_id>` outputs `entries` in frontmatter for drill-down discovery.
208
- - Example:
96
+ ## URI Formats
209
97
 
210
- ```bash
211
- xurl agents://pi/12cb4c19-2774-4de4-a0d0-9fa32fbae29f
212
- xurl agents://pi/12cb4c19-2774-4de4-a0d0-9fa32fbae29f/d1b2c3d4
213
- xurl -I agents://pi/12cb4c19-2774-4de4-a0d0-9fa32fbae29f
98
+ ```text
99
+ agents://<provider>/<conversation_target>
214
100
  ```
215
101
 
216
- ## Release Automation
102
+ For examples:
217
103
 
218
- - `release.yml` (tag push `v*`) builds native binaries and publishes GitHub release assets (`xurl-<version>-<target>.tar.gz` + checksums + manifest).
219
- - `homebrew-publish.yml` consumes `release.yml` metadata and updates `xuanwo/tap` formula.
220
- - `npm-publish.yml` and `pypi-publish.yml` keep their original filenames for trusted publisher compatibility, but now consume artifacts from `release.yml` instead of rebuilding binaries.
104
+ ```text
105
+ agents://codex/threads/<conversation_id>
106
+ ```
package/package.json CHANGED
@@ -1,27 +1,21 @@
1
1
  {
2
2
  "name": "@xuanwo/xurl",
3
- "version": "0.0.15",
3
+ "version": "0.0.16-darwin-x64",
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
+ "x64"
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.15-linux-x64",
21
- "@xuanwo/xurl-linux-arm64": "npm:@xuanwo/xurl@0.0.15-linux-arm64",
22
- "@xuanwo/xurl-darwin-x64": "npm:@xuanwo/xurl@0.0.15-darwin-x64",
23
- "@xuanwo/xurl-darwin-arm64": "npm:@xuanwo/xurl@0.0.15-darwin-arm64",
24
- "@xuanwo/xurl-win32-x64": "npm:@xuanwo/xurl@0.0.15-win32-x64",
25
- "@xuanwo/xurl-win32-arm64": "npm:@xuanwo/xurl@0.0.15-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
- }