@hijarvis/cli 0.0.0
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/dist/main.mjs +249 -0
- package/dist/main.mjs.map +1 -0
- package/package.json +39 -0
package/dist/main.mjs
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { buildDefaultSkillTriggerText, executeIngressCommand, listThreads, loadRuntimeConfig, loadThreadMessages, maybeExecuteSideQuestionIngress, preparePromptWithSkills } from "@hijarvis/core";
|
|
5
|
+
import { runRepl } from "@hijarvis/repl-ink";
|
|
6
|
+
//#region src/render-agent-event.ts
|
|
7
|
+
const renderAgentEvent = (event, writers) => {
|
|
8
|
+
switch (event.type) {
|
|
9
|
+
case "message_update":
|
|
10
|
+
if (event.assistantMessageEvent.type === "text_delta") writers.stdout.write(event.assistantMessageEvent.delta);
|
|
11
|
+
break;
|
|
12
|
+
case "tool_execution_start":
|
|
13
|
+
writers.stderr.write(`\n[tool:start] ${event.toolName} ${JSON.stringify(event.args)}\n`);
|
|
14
|
+
break;
|
|
15
|
+
case "tool_execution_end":
|
|
16
|
+
writers.stderr.write(`[tool:end] ${event.toolName}\n`);
|
|
17
|
+
break;
|
|
18
|
+
default: break;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/main.ts
|
|
23
|
+
const main = async () => {
|
|
24
|
+
const cliOptions = parseCliOptions(process.argv.slice(2));
|
|
25
|
+
if (cliOptions.helpRequested) {
|
|
26
|
+
printUsage();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (cliOptions.repl && !process.stdin.isTTY) throw new Error("REPL mode requires a TTY stdin.");
|
|
30
|
+
const config = await loadRuntimeConfig(cliOptions.configPath);
|
|
31
|
+
if (cliOptions.listThreads) {
|
|
32
|
+
const threads = await listThreads(config.sessions.rootDir);
|
|
33
|
+
if (threads.length === 0) {
|
|
34
|
+
process.stdout.write("No threads found.\n");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
for (const thread of threads) process.stdout.write(`${thread.threadId} (${thread.provider}/${thread.model}) updated=${new Date(thread.updatedAt).toISOString()}\n`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (cliOptions.repl) {
|
|
41
|
+
const threadId = cliOptions.threadId ?? "main";
|
|
42
|
+
await runRepl({
|
|
43
|
+
initialMessages: await loadThreadMessages({
|
|
44
|
+
rootDir: config.sessions.rootDir,
|
|
45
|
+
provider: config.agent.provider,
|
|
46
|
+
model: config.agent.model,
|
|
47
|
+
threadId
|
|
48
|
+
}),
|
|
49
|
+
executePrompt: async (input, _writers, onEvent) => {
|
|
50
|
+
const sideQuestion = await maybeExecuteSideQuestionIngress({
|
|
51
|
+
config,
|
|
52
|
+
parentThreadId: threadId,
|
|
53
|
+
input,
|
|
54
|
+
source: { platform: "cli" }
|
|
55
|
+
});
|
|
56
|
+
if (sideQuestion.handled) {
|
|
57
|
+
process.stdout.write(`${sideQuestion.result.outputText.trim() || "I do not have a side-question reply."}\n`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
await executeIngressCommand({
|
|
61
|
+
config,
|
|
62
|
+
command: {
|
|
63
|
+
kind: "message",
|
|
64
|
+
source: { platform: "cli" },
|
|
65
|
+
routing: {
|
|
66
|
+
platform: "cli",
|
|
67
|
+
scope: {
|
|
68
|
+
kind: "local_thread",
|
|
69
|
+
threadId
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
message: { text: input },
|
|
73
|
+
prompt: input,
|
|
74
|
+
audit: { trigger: "user_input" },
|
|
75
|
+
execution: { onEvent }
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
initialPrompt: await readPrompt(cliOptions.prompt)
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const prompt = await readPrompt(cliOptions.prompt);
|
|
84
|
+
if (prompt === void 0) {
|
|
85
|
+
printUsage();
|
|
86
|
+
throw new Error("Missing prompt. Pass text as an argument or pipe it through stdin.");
|
|
87
|
+
}
|
|
88
|
+
if (cliOptions.threadId !== void 0) {
|
|
89
|
+
const sideQuestion = await maybeExecuteSideQuestionIngress({
|
|
90
|
+
config,
|
|
91
|
+
parentThreadId: cliOptions.threadId,
|
|
92
|
+
input: prompt,
|
|
93
|
+
source: { platform: "cli" }
|
|
94
|
+
});
|
|
95
|
+
if (sideQuestion.handled) process.stdout.write(`${sideQuestion.result.outputText.trim() || "I do not have a side-question reply."}`);
|
|
96
|
+
else await executeIngressCommand({
|
|
97
|
+
config,
|
|
98
|
+
command: {
|
|
99
|
+
kind: "message",
|
|
100
|
+
source: { platform: "cli" },
|
|
101
|
+
routing: {
|
|
102
|
+
platform: "cli",
|
|
103
|
+
scope: {
|
|
104
|
+
kind: "local_thread",
|
|
105
|
+
threadId: cliOptions.threadId
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
message: { text: prompt },
|
|
109
|
+
prompt,
|
|
110
|
+
audit: { trigger: "user_input" },
|
|
111
|
+
execution: { onEvent: (event) => {
|
|
112
|
+
renderAgentEvent(event, {
|
|
113
|
+
stdout: process.stdout,
|
|
114
|
+
stderr: process.stderr
|
|
115
|
+
});
|
|
116
|
+
} }
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
const prepared = await preparePromptWithSkills(prompt, {
|
|
121
|
+
skills: config.skills,
|
|
122
|
+
triggerText: prompt
|
|
123
|
+
});
|
|
124
|
+
const oneShotThreadId = `oneshot__${Date.now()}`;
|
|
125
|
+
await executeIngressCommand({
|
|
126
|
+
config,
|
|
127
|
+
command: {
|
|
128
|
+
kind: "message",
|
|
129
|
+
source: { platform: "cli" },
|
|
130
|
+
routing: {
|
|
131
|
+
platform: "cli",
|
|
132
|
+
scope: {
|
|
133
|
+
kind: "local_thread",
|
|
134
|
+
threadId: oneShotThreadId
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
message: { text: prompt },
|
|
138
|
+
prompt: prepared.prompt,
|
|
139
|
+
skillTriggerText: buildDefaultSkillTriggerText({
|
|
140
|
+
kind: "message",
|
|
141
|
+
source: { platform: "cli" },
|
|
142
|
+
routing: {
|
|
143
|
+
platform: "cli",
|
|
144
|
+
scope: {
|
|
145
|
+
kind: "local_thread",
|
|
146
|
+
threadId: oneShotThreadId
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
message: { text: prompt },
|
|
150
|
+
prompt,
|
|
151
|
+
audit: { trigger: "user_input" }
|
|
152
|
+
}),
|
|
153
|
+
audit: { trigger: "user_input" },
|
|
154
|
+
execution: { onEvent: (event) => {
|
|
155
|
+
renderAgentEvent(event, {
|
|
156
|
+
stdout: process.stdout,
|
|
157
|
+
stderr: process.stderr
|
|
158
|
+
});
|
|
159
|
+
} }
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (!process.stdout.write("\n")) await onceDrain();
|
|
164
|
+
};
|
|
165
|
+
const parseCliOptions = (argv) => {
|
|
166
|
+
let configPath = "jar.toml";
|
|
167
|
+
const promptSegments = [];
|
|
168
|
+
let helpRequested = false;
|
|
169
|
+
let repl = false;
|
|
170
|
+
let threadId;
|
|
171
|
+
let listThreadsFlag = false;
|
|
172
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
173
|
+
const argument = argv[index];
|
|
174
|
+
if (argument === void 0) continue;
|
|
175
|
+
if (argument === "--") continue;
|
|
176
|
+
if (argument === "--help" || argument === "-h") {
|
|
177
|
+
helpRequested = true;
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (argument === "--config" || argument === "-c") {
|
|
181
|
+
const nextValue = argv[index + 1];
|
|
182
|
+
if (nextValue === void 0) throw new Error("Expected a file path after --config");
|
|
183
|
+
configPath = nextValue;
|
|
184
|
+
index += 1;
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (argument === "--thread" || argument === "-t") {
|
|
188
|
+
const nextValue = argv[index + 1];
|
|
189
|
+
if (nextValue === void 0) throw new Error("Expected a thread id after --thread");
|
|
190
|
+
threadId = nextValue;
|
|
191
|
+
index += 1;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (argument === "--repl") {
|
|
195
|
+
repl = true;
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (argument === "--list-threads") {
|
|
199
|
+
listThreadsFlag = true;
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
promptSegments.push(argument);
|
|
203
|
+
}
|
|
204
|
+
const cliOptions = {
|
|
205
|
+
configPath: path.resolve(configPath),
|
|
206
|
+
helpRequested,
|
|
207
|
+
repl,
|
|
208
|
+
listThreads: listThreadsFlag,
|
|
209
|
+
threadId
|
|
210
|
+
};
|
|
211
|
+
if (promptSegments.length > 0) cliOptions.prompt = promptSegments.join(" ");
|
|
212
|
+
return cliOptions;
|
|
213
|
+
};
|
|
214
|
+
const readPrompt = async (inlinePrompt) => {
|
|
215
|
+
if (inlinePrompt !== void 0) return inlinePrompt;
|
|
216
|
+
if (process.stdin.isTTY) return;
|
|
217
|
+
const stdinChunks = [];
|
|
218
|
+
for await (const chunk of process.stdin) stdinChunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
219
|
+
const stdinPrompt = Buffer.concat(stdinChunks).toString("utf8").trim();
|
|
220
|
+
return stdinPrompt.length > 0 ? stdinPrompt : void 0;
|
|
221
|
+
};
|
|
222
|
+
const printUsage = () => {
|
|
223
|
+
process.stdout.write(`Usage: pnpm dev -- --config ./apps/jar-cli/jar.toml "Your prompt here"
|
|
224
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml --repl
|
|
225
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml --thread my-thread "Continue this thread"
|
|
226
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml --list-threads
|
|
227
|
+
|
|
228
|
+
Examples:
|
|
229
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml "Read package.json and summarize the scripts."
|
|
230
|
+
echo "Run git status and explain the workspace state." | pnpm dev -- --config ./apps/jar-cli/jar.toml
|
|
231
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml --repl
|
|
232
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml --thread my-thread --repl
|
|
233
|
+
pnpm dev -- --config ./apps/jar-cli/jar.toml --list-threads
|
|
234
|
+
`);
|
|
235
|
+
};
|
|
236
|
+
const onceDrain = async () => {
|
|
237
|
+
await new Promise((resolve) => {
|
|
238
|
+
process.stdout.once("drain", resolve);
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
await main().catch((error) => {
|
|
242
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
243
|
+
process.stderr.write(`${message}\n`);
|
|
244
|
+
process.exitCode = 1;
|
|
245
|
+
});
|
|
246
|
+
//#endregion
|
|
247
|
+
export {};
|
|
248
|
+
|
|
249
|
+
//# sourceMappingURL=main.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.mjs","names":[],"sources":["../src/render-agent-event.ts","../src/main.ts"],"sourcesContent":["import type { AgentEvent } from \"@mariozechner/pi-agent-core\";\n\ntype CliRenderWriters = {\n stdout: Pick<NodeJS.WriteStream, \"write\">;\n stderr: Pick<NodeJS.WriteStream, \"write\">;\n};\n\nexport const renderAgentEvent = (\n event: AgentEvent,\n writers: CliRenderWriters,\n): void => {\n switch (event.type) {\n case \"message_update\":\n if (event.assistantMessageEvent.type === \"text_delta\") {\n writers.stdout.write(event.assistantMessageEvent.delta);\n }\n break;\n case \"tool_execution_start\":\n writers.stderr.write(\n `\\n[tool:start] ${event.toolName} ${JSON.stringify(event.args)}\\n`,\n );\n break;\n case \"tool_execution_end\":\n writers.stderr.write(`[tool:end] ${event.toolName}\\n`);\n break;\n default:\n break;\n }\n};\n","import path from \"node:path\";\nimport process from \"node:process\";\n\nimport {\n buildDefaultSkillTriggerText,\n executeIngressCommand,\n maybeExecuteSideQuestionIngress,\n listThreads,\n loadRuntimeConfig,\n loadThreadMessages,\n preparePromptWithSkills,\n type MessageIngressCommand,\n} from \"@hijarvis/core\";\nimport { runRepl } from \"@hijarvis/repl-ink\";\n\nimport { renderAgentEvent } from \"./render-agent-event.js\";\n\ntype CliOptions = {\n configPath: string;\n prompt?: string;\n helpRequested: boolean;\n repl: boolean;\n threadId?: string;\n listThreads: boolean;\n};\n\nconst main = async (): Promise<void> => {\n const cliOptions = parseCliOptions(process.argv.slice(2));\n\n if (cliOptions.helpRequested) {\n printUsage();\n return;\n }\n\n if (cliOptions.repl && !process.stdin.isTTY) {\n throw new Error(\"REPL mode requires a TTY stdin.\");\n }\n\n const config = await loadRuntimeConfig(cliOptions.configPath);\n if (cliOptions.listThreads) {\n const threads = await listThreads(config.sessions.rootDir);\n if (threads.length === 0) {\n process.stdout.write(\"No threads found.\\n\");\n return;\n }\n for (const thread of threads) {\n process.stdout.write(\n `${thread.threadId} (${thread.provider}/${thread.model}) updated=${new Date(\n thread.updatedAt,\n ).toISOString()}\\n`,\n );\n }\n return;\n }\n if (cliOptions.repl) {\n const threadId = cliOptions.threadId ?? \"main\";\n const initialMessages = await loadThreadMessages({\n rootDir: config.sessions.rootDir,\n provider: config.agent.provider,\n model: config.agent.model,\n threadId,\n });\n\n const prompt = await readPrompt(cliOptions.prompt);\n await runRepl({\n initialMessages,\n executePrompt: async (\n input: string,\n _writers: { stderr: Pick<NodeJS.WriteStream, \"write\"> },\n onEvent,\n ) => {\n const sideQuestion = await maybeExecuteSideQuestionIngress({\n config,\n parentThreadId: threadId,\n input,\n source: { platform: \"cli\" },\n });\n if (sideQuestion.handled) {\n process.stdout.write(`${sideQuestion.result.outputText.trim() || \"I do not have a side-question reply.\"}\\n`);\n return;\n }\n\n const command: MessageIngressCommand = {\n kind: \"message\",\n source: { platform: \"cli\" },\n routing: {\n platform: \"cli\",\n scope: {\n kind: \"local_thread\",\n threadId,\n },\n },\n message: {\n text: input,\n },\n prompt: input,\n audit: {\n trigger: \"user_input\",\n },\n execution: {\n onEvent,\n },\n };\n\n await executeIngressCommand({\n config,\n command,\n });\n },\n initialPrompt: prompt,\n });\n return;\n }\n\n const prompt = await readPrompt(cliOptions.prompt);\n if (prompt === undefined) {\n printUsage();\n throw new Error(\"Missing prompt. Pass text as an argument or pipe it through stdin.\");\n }\n\n if (cliOptions.threadId !== undefined) {\n const sideQuestion = await maybeExecuteSideQuestionIngress({\n config,\n parentThreadId: cliOptions.threadId,\n input: prompt,\n source: { platform: \"cli\" },\n });\n if (sideQuestion.handled) {\n process.stdout.write(`${sideQuestion.result.outputText.trim() || \"I do not have a side-question reply.\"}`);\n } else {\n await executeIngressCommand({\n config,\n command: {\n kind: \"message\",\n source: { platform: \"cli\" },\n routing: {\n platform: \"cli\",\n scope: {\n kind: \"local_thread\",\n threadId: cliOptions.threadId,\n },\n },\n message: { text: prompt },\n prompt,\n audit: { trigger: \"user_input\" },\n execution: {\n onEvent: (event) => {\n renderAgentEvent(event, { stdout: process.stdout, stderr: process.stderr });\n },\n },\n },\n });\n }\n } else {\n const prepared = await preparePromptWithSkills(prompt, {\n skills: config.skills,\n triggerText: prompt,\n });\n const oneShotThreadId = `oneshot__${Date.now()}`;\n const command: MessageIngressCommand = {\n kind: \"message\",\n source: { platform: \"cli\" },\n routing: {\n platform: \"cli\",\n scope: {\n kind: \"local_thread\",\n threadId: oneShotThreadId,\n },\n },\n message: { text: prompt },\n prompt: prepared.prompt,\n skillTriggerText: buildDefaultSkillTriggerText({\n kind: \"message\",\n source: { platform: \"cli\" },\n routing: {\n platform: \"cli\",\n scope: { kind: \"local_thread\", threadId: oneShotThreadId },\n },\n message: { text: prompt },\n prompt,\n audit: { trigger: \"user_input\" },\n }),\n audit: { trigger: \"user_input\" },\n execution: {\n onEvent: (event) => {\n renderAgentEvent(event, { stdout: process.stdout, stderr: process.stderr });\n },\n },\n };\n await executeIngressCommand({ config, command });\n }\n if (!process.stdout.write(\"\\n\")) {\n await onceDrain();\n }\n};\n\nconst parseCliOptions = (argv: string[]): CliOptions => {\n let configPath = \"jar.toml\";\n const promptSegments: string[] = [];\n let helpRequested = false;\n let repl = false;\n let threadId: string | undefined;\n let listThreadsFlag = false;\n\n for (let index = 0; index < argv.length; index += 1) {\n const argument = argv[index];\n if (argument === undefined) {\n continue;\n }\n\n if (argument === \"--\") {\n continue;\n }\n\n if (argument === \"--help\" || argument === \"-h\") {\n helpRequested = true;\n continue;\n }\n\n if (argument === \"--config\" || argument === \"-c\") {\n const nextValue = argv[index + 1];\n if (nextValue === undefined) {\n throw new Error(\"Expected a file path after --config\");\n }\n\n configPath = nextValue;\n index += 1;\n continue;\n }\n\n if (argument === \"--thread\" || argument === \"-t\") {\n const nextValue = argv[index + 1];\n if (nextValue === undefined) {\n throw new Error(\"Expected a thread id after --thread\");\n }\n threadId = nextValue;\n index += 1;\n continue;\n }\n\n if (argument === \"--repl\") {\n repl = true;\n continue;\n }\n\n if (argument === \"--list-threads\") {\n listThreadsFlag = true;\n continue;\n }\n\n promptSegments.push(argument);\n }\n\n const cliOptions: CliOptions = {\n configPath: path.resolve(configPath),\n helpRequested,\n repl,\n listThreads: listThreadsFlag,\n threadId,\n };\n\n if (promptSegments.length > 0) {\n cliOptions.prompt = promptSegments.join(\" \");\n }\n\n return cliOptions;\n};\n\nconst readPrompt = async (inlinePrompt?: string): Promise<string | undefined> => {\n if (inlinePrompt !== undefined) {\n return inlinePrompt;\n }\n\n if (process.stdin.isTTY) {\n return undefined;\n }\n\n const stdinChunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n stdinChunks.push(\n typeof chunk === \"string\" ? Buffer.from(chunk) : chunk,\n );\n }\n\n const stdinPrompt = Buffer.concat(stdinChunks).toString(\"utf8\").trim();\n return stdinPrompt.length > 0 ? stdinPrompt : undefined;\n};\n\nconst printUsage = (): void => {\n process.stdout.write(`Usage: pnpm dev -- --config ./apps/jar-cli/jar.toml \"Your prompt here\"\n pnpm dev -- --config ./apps/jar-cli/jar.toml --repl\n pnpm dev -- --config ./apps/jar-cli/jar.toml --thread my-thread \"Continue this thread\"\n pnpm dev -- --config ./apps/jar-cli/jar.toml --list-threads\n\nExamples:\n pnpm dev -- --config ./apps/jar-cli/jar.toml \"Read package.json and summarize the scripts.\"\n echo \"Run git status and explain the workspace state.\" | pnpm dev -- --config ./apps/jar-cli/jar.toml\n pnpm dev -- --config ./apps/jar-cli/jar.toml --repl\n pnpm dev -- --config ./apps/jar-cli/jar.toml --thread my-thread --repl\n pnpm dev -- --config ./apps/jar-cli/jar.toml --list-threads\n`);\n};\n\nconst onceDrain = async (): Promise<void> => {\n await new Promise<void>((resolve) => {\n process.stdout.once(\"drain\", resolve);\n });\n};\n\nawait main().catch((error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n});\n"],"mappings":";;;;;;AAOA,MAAa,oBACX,OACA,YACS;CACT,QAAQ,MAAM,MAAd;EACE,KAAK;GACH,IAAI,MAAM,sBAAsB,SAAS,cACvC,QAAQ,OAAO,MAAM,MAAM,sBAAsB,KAAK;GAExD;EACF,KAAK;GACH,QAAQ,OAAO,MACb,kBAAkB,MAAM,SAAS,GAAG,KAAK,UAAU,MAAM,IAAI,EAAE,GACjE;GACA;EACF,KAAK;GACH,QAAQ,OAAO,MAAM,cAAc,MAAM,SAAS,GAAG;GACrD;EACF,SACE;CACJ;AACF;;;ACFA,MAAM,OAAO,YAA2B;CACtC,MAAM,aAAa,gBAAgB,QAAQ,KAAK,MAAM,CAAC,CAAC;CAExD,IAAI,WAAW,eAAe;EAC5B,WAAW;EACX;CACF;CAEA,IAAI,WAAW,QAAQ,CAAC,QAAQ,MAAM,OACpC,MAAM,IAAI,MAAM,iCAAiC;CAGnD,MAAM,SAAS,MAAM,kBAAkB,WAAW,UAAU;CAC5D,IAAI,WAAW,aAAa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AK,IAAI,KACnD;CAGF,MAAM,cAAc,OAAO,OAAO,WAAW,EAAE,SAAS,MAAM,EAAE,KAAK;CACrE,OAAO,YAAY,SAAS,IAAI,cAAc,KAAA;AAChD;AAEA,MAAM,mBAAyB;CAC7B,QAAQ,OAAO,MAAM;;;;;;;;;;;CAWtB;AACD;AAEA,MAAM,YAAY,YAA2B;CAC3C,MAAM,IAAI,SAAe,YAAY;EACnC,QAAQ,OAAO,KAAK,SAAS,OAAO;CACtC,CAAC;AACH;AAEA,MAAM,KAAK,EAAE,OAAO,UAAmB;CACrC,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,QAAQ,OAAO,MAAM,GAAG,QAAQ,GAAG;CACnC,QAAQ,WAAW;AACrB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hijarvis/cli",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "wibus-wee",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/wibus-wee/HiJarvis.git",
|
|
10
|
+
"directory": "apps/jar-cli"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"bin": {
|
|
16
|
+
"jar": "./dist/main.mjs"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/main.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/main.mjs",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@mariozechner/pi-agent-core": "^0.65.2",
|
|
26
|
+
"zod": "^4.3.6",
|
|
27
|
+
"@hijarvis/core": "0.0.0",
|
|
28
|
+
"@hijarvis/repl-ink": "0.0.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"tsx": "^4.21.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsdown",
|
|
35
|
+
"check": "tsc --noEmit",
|
|
36
|
+
"dev": "tsx src/main.ts",
|
|
37
|
+
"start": "tsx src/main.ts"
|
|
38
|
+
}
|
|
39
|
+
}
|