ryeos-code 0.1.0__py3-none-any.whl
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.
- ryeos_code/.ai/directives/rye/code/diagnostics.md +48 -0
- ryeos_code/.ai/directives/rye/code/lsp.md +50 -0
- ryeos_code/.ai/directives/rye/code/npm.md +50 -0
- ryeos_code/.ai/directives/rye/code/typescript.md +50 -0
- ryeos_code/.ai/knowledge/rye/code/code-tools.md +349 -0
- ryeos_code/.ai/tools/rye/code/diagnostics/diagnostics.ts +347 -0
- ryeos_code/.ai/tools/rye/code/diagnostics/package-lock.json +555 -0
- ryeos_code/.ai/tools/rye/code/diagnostics/package.json +8 -0
- ryeos_code/.ai/tools/rye/code/git/git.py +246 -0
- ryeos_code/.ai/tools/rye/code/lsp/lsp.ts +438 -0
- ryeos_code/.ai/tools/rye/code/lsp/package-lock.json +593 -0
- ryeos_code/.ai/tools/rye/code/lsp/package.json +12 -0
- ryeos_code/.ai/tools/rye/code/npm/npm.ts +212 -0
- ryeos_code/.ai/tools/rye/code/npm/package-lock.json +555 -0
- ryeos_code/.ai/tools/rye/code/npm/package.json +8 -0
- ryeos_code/.ai/tools/rye/code/typescript/package-lock.json +555 -0
- ryeos_code/.ai/tools/rye/code/typescript/package.json +8 -0
- ryeos_code/.ai/tools/rye/code/typescript/typescript.ts +215 -0
- ryeos_code/__init__.py +1 -0
- ryeos_code/bundle.py +13 -0
- ryeos_code-0.1.0.dist-info/METADATA +13 -0
- ryeos_code-0.1.0.dist-info/RECORD +24 -0
- ryeos_code-0.1.0.dist-info/WHEEL +4 -0
- ryeos_code-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// rye:signed:2026-02-25T00:02:14Z:befbbf8422c62eea8a6175e1f1490a8236b1a27195559cd6fe5d9067453f6c2f:syta8ndeK2kVNvwQFzNAZVRvZ2EhzTYVWWvQ-D-bbSSXx549_i2Cn-2DdeilqjZ2RYGBSr48Qvf7YrtUKoP6AA==:9fbfabe975fa5a7f
|
|
2
|
+
// rye:unsigned
|
|
3
|
+
import { parseArgs } from "node:util";
|
|
4
|
+
import { execSync } from "node:child_process";
|
|
5
|
+
import { resolve, isAbsolute, relative } from "node:path";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
|
|
8
|
+
export const __version__ = "1.0.0";
|
|
9
|
+
export const __tool_type__ = "javascript";
|
|
10
|
+
export const __executor_id__ = "rye/core/runtimes/node/node";
|
|
11
|
+
export const __category__ = "rye/code/typescript";
|
|
12
|
+
export const __tool_description__ =
|
|
13
|
+
"TypeScript type checker — run tsc --noEmit for type checking without build";
|
|
14
|
+
|
|
15
|
+
export const CONFIG_SCHEMA = {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
action: {
|
|
19
|
+
type: "string",
|
|
20
|
+
enum: ["check", "check-file"],
|
|
21
|
+
description: "Type check entire project or a single file",
|
|
22
|
+
},
|
|
23
|
+
file_path: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "File to check (for check-file action)",
|
|
26
|
+
},
|
|
27
|
+
working_dir: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Directory containing tsconfig.json",
|
|
30
|
+
},
|
|
31
|
+
strict: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
default: false,
|
|
34
|
+
description: "Enable strict mode",
|
|
35
|
+
},
|
|
36
|
+
timeout: {
|
|
37
|
+
type: "integer",
|
|
38
|
+
default: 60,
|
|
39
|
+
description: "Timeout in seconds",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
required: ["action"],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const MAX_OUTPUT_BYTES = 51200;
|
|
46
|
+
const DEFAULT_TIMEOUT = 60;
|
|
47
|
+
|
|
48
|
+
interface Params {
|
|
49
|
+
action: string;
|
|
50
|
+
file_path?: string;
|
|
51
|
+
working_dir?: string;
|
|
52
|
+
strict?: boolean;
|
|
53
|
+
timeout?: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface Diagnostic {
|
|
57
|
+
file: string;
|
|
58
|
+
line: number;
|
|
59
|
+
column: number;
|
|
60
|
+
severity: string;
|
|
61
|
+
message: string;
|
|
62
|
+
code: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface Result {
|
|
66
|
+
success: boolean;
|
|
67
|
+
output?: string;
|
|
68
|
+
error?: string;
|
|
69
|
+
diagnostics?: Diagnostic[];
|
|
70
|
+
error_count?: number;
|
|
71
|
+
command?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function parseTscOutput(output: string, projectPath: string): Diagnostic[] {
|
|
75
|
+
const diagnostics: Diagnostic[] = [];
|
|
76
|
+
const pattern = /^(.+?)\((\d+),(\d+)\): (error|warning) (TS\d+): (.+)/;
|
|
77
|
+
|
|
78
|
+
for (const line of output.split("\n")) {
|
|
79
|
+
const match = line.match(pattern);
|
|
80
|
+
if (match) {
|
|
81
|
+
let file = match[1];
|
|
82
|
+
try {
|
|
83
|
+
file = relative(projectPath, file);
|
|
84
|
+
} catch {
|
|
85
|
+
// keep absolute
|
|
86
|
+
}
|
|
87
|
+
diagnostics.push({
|
|
88
|
+
file,
|
|
89
|
+
line: parseInt(match[2], 10),
|
|
90
|
+
column: parseInt(match[3], 10),
|
|
91
|
+
severity: match[4],
|
|
92
|
+
message: match[6],
|
|
93
|
+
code: match[5],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return diagnostics;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function execute(params: Params, projectPath: string): Result {
|
|
102
|
+
const project = resolve(projectPath);
|
|
103
|
+
|
|
104
|
+
if (!params.action) {
|
|
105
|
+
return { success: false, error: "Missing required parameter: action" };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (params.action === "check-file" && !params.file_path) {
|
|
109
|
+
return {
|
|
110
|
+
success: false,
|
|
111
|
+
error: "check-file action requires file_path parameter",
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const timeout = (params.timeout ?? DEFAULT_TIMEOUT) * 1000;
|
|
116
|
+
|
|
117
|
+
let cwd = project;
|
|
118
|
+
if (params.working_dir) {
|
|
119
|
+
cwd = isAbsolute(params.working_dir)
|
|
120
|
+
? resolve(params.working_dir)
|
|
121
|
+
: resolve(project, params.working_dir);
|
|
122
|
+
|
|
123
|
+
if (!existsSync(cwd)) {
|
|
124
|
+
return { success: false, error: `Working directory not found: ${cwd}` };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const cmdParts = ["tsc", "--noEmit", "--pretty", "false"];
|
|
129
|
+
|
|
130
|
+
if (params.strict) {
|
|
131
|
+
cmdParts.push("--strict");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (params.action === "check-file" && params.file_path) {
|
|
135
|
+
const filePath = isAbsolute(params.file_path)
|
|
136
|
+
? params.file_path
|
|
137
|
+
: resolve(project, params.file_path);
|
|
138
|
+
|
|
139
|
+
if (!existsSync(filePath)) {
|
|
140
|
+
return { success: false, error: `File not found: ${filePath}` };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
cmdParts.push(filePath);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const cmdStr = cmdParts.join(" ");
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
const output = execSync(cmdStr, {
|
|
150
|
+
cwd,
|
|
151
|
+
timeout,
|
|
152
|
+
encoding: "utf-8",
|
|
153
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
success: true,
|
|
158
|
+
output: output?.trim() || "No type errors found.",
|
|
159
|
+
diagnostics: [],
|
|
160
|
+
error_count: 0,
|
|
161
|
+
command: cmdStr,
|
|
162
|
+
};
|
|
163
|
+
} catch (e: any) {
|
|
164
|
+
if (e.killed) {
|
|
165
|
+
return {
|
|
166
|
+
success: false,
|
|
167
|
+
error: `tsc timed out after ${params.timeout ?? DEFAULT_TIMEOUT} seconds`,
|
|
168
|
+
command: cmdStr,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const combined = (e.stdout ?? "") + (e.stderr ?? "");
|
|
173
|
+
const diagnostics = parseTscOutput(combined, project);
|
|
174
|
+
const errorCount = diagnostics.filter(
|
|
175
|
+
(d) => d.severity === "error",
|
|
176
|
+
).length;
|
|
177
|
+
|
|
178
|
+
let output = diagnostics
|
|
179
|
+
.map(
|
|
180
|
+
(d) =>
|
|
181
|
+
`${d.file}(${d.line},${d.column}): ${d.severity} ${d.code}: ${d.message}`,
|
|
182
|
+
)
|
|
183
|
+
.join("\n");
|
|
184
|
+
|
|
185
|
+
if (!output) output = combined.trim();
|
|
186
|
+
|
|
187
|
+
if (output.length > MAX_OUTPUT_BYTES) {
|
|
188
|
+
output = output.slice(0, MAX_OUTPUT_BYTES) + "\n... [output truncated]";
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
success: errorCount === 0,
|
|
193
|
+
output,
|
|
194
|
+
diagnostics,
|
|
195
|
+
error_count: errorCount,
|
|
196
|
+
command: cmdStr,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// CLI entry point
|
|
202
|
+
const { values } = parseArgs({
|
|
203
|
+
options: {
|
|
204
|
+
params: { type: "string" },
|
|
205
|
+
"project-path": { type: "string" },
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
if (values.params && values["project-path"]) {
|
|
210
|
+
const result = execute(
|
|
211
|
+
JSON.parse(values.params) as Params,
|
|
212
|
+
values["project-path"],
|
|
213
|
+
);
|
|
214
|
+
console.log(JSON.stringify(result));
|
|
215
|
+
}
|
ryeos_code/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""RYE OS Code Bundle — git, npm, typescript, LSP, and diagnostics tools."""
|
ryeos_code/bundle.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Bundle entry point for ryeos-code package."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def get_bundle() -> dict:
|
|
7
|
+
"""Return ryeos-code bundle — rye/code/* items (git, npm, typescript, lsp, diagnostics)."""
|
|
8
|
+
return {
|
|
9
|
+
"bundle_id": "ryeos-code",
|
|
10
|
+
"version": "0.1.0",
|
|
11
|
+
"root_path": Path(__file__).parent,
|
|
12
|
+
"categories": ["rye/code"],
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ryeos-code
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: RYE Code Bundle — git, npm, typescript, LSP, and diagnostics tools
|
|
5
|
+
Project-URL: Homepage, https://github.com/leolilley/ryeos
|
|
6
|
+
Project-URL: Repository, https://github.com/leolilley/ryeos
|
|
7
|
+
Author-email: Leo Lilley <leo.lml.lilley@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Requires-Dist: ryeos
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
ryeos_code/__init__.py,sha256=7gmOWnt-iJA_fnFwcnla4mxJ_eC58gDjmTnKWP0TxqA,79
|
|
2
|
+
ryeos_code/bundle.py,sha256=DB8Lcc62hPkG_WrEJVcC1NumUNHwip-vOK7bHH0dqRQ,363
|
|
3
|
+
ryeos_code/.ai/directives/rye/code/diagnostics.md,sha256=eMJEbXwkLuBKKIPOVAYhK9ohaLW8H2GTAzVYD43uVog,2006
|
|
4
|
+
ryeos_code/.ai/directives/rye/code/lsp.md,sha256=Ex1ULZk7DmXxbgPrydEaVaMjb-WIDA0nxMuV4EM80Us,2321
|
|
5
|
+
ryeos_code/.ai/directives/rye/code/npm.md,sha256=29kzkSQACeT1dqPAj2acClVEiiV5HJTgl4RnvdYHHzM,2212
|
|
6
|
+
ryeos_code/.ai/directives/rye/code/typescript.md,sha256=3khQ6yZbr7Wmv9FzHwFaCUyCrXUEKd4RS9J2bZgA3LE,2237
|
|
7
|
+
ryeos_code/.ai/knowledge/rye/code/code-tools.md,sha256=txb4oiagK-IbL2Sm0z2eoJ3NTSX5IfDxyXTK2l_K6cE,13730
|
|
8
|
+
ryeos_code/.ai/tools/rye/code/diagnostics/diagnostics.ts,sha256=WnuaVo1Gn8Fv8V2xJidVXlw5QDCdtm2O1tDwh7lWuh8,9274
|
|
9
|
+
ryeos_code/.ai/tools/rye/code/diagnostics/package-lock.json,sha256=l5xjfk1bax9UM19OSC7hiN9Bl-1jdvG7jlZNP9WLCl0,16390
|
|
10
|
+
ryeos_code/.ai/tools/rye/code/diagnostics/package.json,sha256=vZlrJpI14nX7Ggc8S2Rylmi3962gUlEcBLXayU8VntU,124
|
|
11
|
+
ryeos_code/.ai/tools/rye/code/git/git.py,sha256=hMZfX4N8EY5x5vJQOHVf8hiok1R5U-zi4-t2_MaAN58,8105
|
|
12
|
+
ryeos_code/.ai/tools/rye/code/lsp/lsp.ts,sha256=GizYSZJcE2UTCD6duFYFanraow8VIC0OFDq_jh0GQ2E,11329
|
|
13
|
+
ryeos_code/.ai/tools/rye/code/lsp/package-lock.json,sha256=L8XOw-XErntvRp5EVpX83Vw_ZMASIGmK6Rqj__eax4Y,18060
|
|
14
|
+
ryeos_code/.ai/tools/rye/code/lsp/package.json,sha256=SbV7rtyBwvOtBB1SzF1fDfPcLqDUdPn1jzzHZt4Lh18,221
|
|
15
|
+
ryeos_code/.ai/tools/rye/code/npm/npm.ts,sha256=PsFxli4kyLNMe3FcRHUlIPGxAvnFuxs-n-xny3izmVQ,5786
|
|
16
|
+
ryeos_code/.ai/tools/rye/code/npm/package-lock.json,sha256=Xa-TU5-8E3l7rfh9tfQh-X9UNDHBrbHwUhSmLz6yULs,16374
|
|
17
|
+
ryeos_code/.ai/tools/rye/code/npm/package.json,sha256=Lp32K5YFK9G7HHZL9ts2HjTAX9FGbAXD3bm7-KaZYDU,116
|
|
18
|
+
ryeos_code/.ai/tools/rye/code/typescript/package-lock.json,sha256=1IWfdxFQWLEazkorU2nqXfTV8UYLHxyuq-AwGmOMEKk,16388
|
|
19
|
+
ryeos_code/.ai/tools/rye/code/typescript/package.json,sha256=H7_7DbIkl2AsfPSFv1QbtCSa8DkqBKNTZ1su78zQznQ,123
|
|
20
|
+
ryeos_code/.ai/tools/rye/code/typescript/typescript.ts,sha256=WjZIKlrfa8JXxCUIB63vzWeKMs7Vw8txD-Hsj7cmEQo,5288
|
|
21
|
+
ryeos_code-0.1.0.dist-info/METADATA,sha256=424psnB0BEmxMHeObl_1zDkdrUOByPvRvR2PH_vjDaY,514
|
|
22
|
+
ryeos_code-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
23
|
+
ryeos_code-0.1.0.dist-info/entry_points.txt,sha256=NVRFH5DE96t4m1VT8xny4hnRZEYtdT1mU6ID3A5A1OM,56
|
|
24
|
+
ryeos_code-0.1.0.dist-info/RECORD,,
|