shipr-agent 0.1.6 → 0.1.7
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/index.js +109 -23
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -101201,12 +101201,92 @@ var init_mission_runner = __esm(async () => {
|
|
|
101201
101201
|
await init_renderer3();
|
|
101202
101202
|
});
|
|
101203
101203
|
|
|
101204
|
+
// package.json
|
|
101205
|
+
var require_package3 = __commonJS((exports, module) => {
|
|
101206
|
+
module.exports = {
|
|
101207
|
+
name: "shipr-agent",
|
|
101208
|
+
version: "0.1.7",
|
|
101209
|
+
description: "Fully autonomous terminal-based coding agent",
|
|
101210
|
+
type: "module",
|
|
101211
|
+
bin: {
|
|
101212
|
+
shipr: "./dist/index.js"
|
|
101213
|
+
},
|
|
101214
|
+
main: "./dist/index.js",
|
|
101215
|
+
files: [
|
|
101216
|
+
"dist/",
|
|
101217
|
+
"README.md",
|
|
101218
|
+
"LICENSE"
|
|
101219
|
+
],
|
|
101220
|
+
scripts: {
|
|
101221
|
+
dev: "bun src/index.ts",
|
|
101222
|
+
build: `bun build src/index.ts --outdir dist --target node --format esm && node -e "const fs=require('fs');const f='dist/index.js';const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));let c=fs.readFileSync(f,'utf8');c=c.replace('#!/usr/bin/env bun','#!/usr/bin/env node');c=c.replace('0.1.7',pkg.version);fs.writeFileSync(f,c)"`,
|
|
101223
|
+
"build:bin": "bun build src/index.ts --compile --outfile shipr",
|
|
101224
|
+
typecheck: "bunx tsc --noEmit",
|
|
101225
|
+
lint: "bunx biome check src/",
|
|
101226
|
+
"lint:fix": "bunx biome check src/ --write",
|
|
101227
|
+
test: "bun test",
|
|
101228
|
+
check: "bun run typecheck && bun run lint && bun test",
|
|
101229
|
+
prepublishOnly: "bun run typecheck && bun run build",
|
|
101230
|
+
postpublish: "npm install -g shipr-agent@latest"
|
|
101231
|
+
},
|
|
101232
|
+
keywords: [
|
|
101233
|
+
"ai",
|
|
101234
|
+
"coding-agent",
|
|
101235
|
+
"cli",
|
|
101236
|
+
"autonomous",
|
|
101237
|
+
"llm",
|
|
101238
|
+
"copilot",
|
|
101239
|
+
"openai",
|
|
101240
|
+
"anthropic",
|
|
101241
|
+
"terminal"
|
|
101242
|
+
],
|
|
101243
|
+
author: "praveenmalik",
|
|
101244
|
+
license: "MIT",
|
|
101245
|
+
engines: {
|
|
101246
|
+
node: ">=18",
|
|
101247
|
+
bun: ">=1.0"
|
|
101248
|
+
},
|
|
101249
|
+
repository: {
|
|
101250
|
+
type: "git",
|
|
101251
|
+
url: "https://github.com/praveenmalik/shipr"
|
|
101252
|
+
},
|
|
101253
|
+
homepage: "https://github.com/praveenmalik/shipr#readme",
|
|
101254
|
+
dependencies: {
|
|
101255
|
+
"@aws-sdk/client-bedrock-runtime": "^3.1016.0",
|
|
101256
|
+
chalk: "^5.6.2",
|
|
101257
|
+
commander: "^14.0.3",
|
|
101258
|
+
ink: "^6.8.0",
|
|
101259
|
+
"js-yaml": "^4.1.1",
|
|
101260
|
+
ora: "^9.3.0",
|
|
101261
|
+
react: "^19.2.4",
|
|
101262
|
+
"simple-git": "^3.33.0",
|
|
101263
|
+
zod: "^4.3.6"
|
|
101264
|
+
},
|
|
101265
|
+
devDependencies: {
|
|
101266
|
+
"@biomejs/biome": "^2.4.8",
|
|
101267
|
+
"@types/js-yaml": "^4.0.9",
|
|
101268
|
+
"@types/react": "^19.2.14",
|
|
101269
|
+
"bun-types": "^1.3.11",
|
|
101270
|
+
"react-devtools-core": "^7.0.1",
|
|
101271
|
+
typescript: "^6.0.2"
|
|
101272
|
+
}
|
|
101273
|
+
};
|
|
101274
|
+
});
|
|
101275
|
+
|
|
101204
101276
|
// src/cli/repl.ts
|
|
101205
101277
|
var exports_repl = {};
|
|
101206
101278
|
__export(exports_repl, {
|
|
101207
101279
|
startRepl: () => startRepl
|
|
101208
101280
|
});
|
|
101209
101281
|
import { createInterface as createInterface3 } from "node:readline";
|
|
101282
|
+
function getVersion() {
|
|
101283
|
+
try {
|
|
101284
|
+
const pkg = require_package3();
|
|
101285
|
+
return pkg.version;
|
|
101286
|
+
} catch {
|
|
101287
|
+
return "__SHIPR_VERSION__";
|
|
101288
|
+
}
|
|
101289
|
+
}
|
|
101210
101290
|
async function detectActiveProvider() {
|
|
101211
101291
|
const providers = listProviders();
|
|
101212
101292
|
for (const name of providers) {
|
|
@@ -101234,14 +101314,19 @@ function getAllModelsForProvider(providerName) {
|
|
|
101234
101314
|
const p = factory();
|
|
101235
101315
|
return p.getModels().map((m) => m.id);
|
|
101236
101316
|
}
|
|
101237
|
-
function commandPicker(initial) {
|
|
101317
|
+
function commandPicker(initial, rl) {
|
|
101238
101318
|
return new Promise((resolve) => {
|
|
101239
101319
|
let query = initial;
|
|
101240
101320
|
let selectedIdx = 0;
|
|
101241
101321
|
let scrollTop = 0;
|
|
101242
101322
|
let drawnLines = 0;
|
|
101243
101323
|
const stdin = process.stdin;
|
|
101244
|
-
const
|
|
101324
|
+
const savedData = stdin.rawListeners("data").slice();
|
|
101325
|
+
const savedKeypress = stdin.rawListeners("keypress").slice();
|
|
101326
|
+
stdin.removeAllListeners("data");
|
|
101327
|
+
stdin.removeAllListeners("keypress");
|
|
101328
|
+
stdin.resume();
|
|
101329
|
+
stdin.setRawMode(true);
|
|
101245
101330
|
function filtered() {
|
|
101246
101331
|
const q = query.slice(1).toLowerCase();
|
|
101247
101332
|
if (!q)
|
|
@@ -101292,10 +101377,10 @@ function commandPicker(initial) {
|
|
|
101292
101377
|
}
|
|
101293
101378
|
function cleanup() {
|
|
101294
101379
|
stdin.removeListener("data", onKey);
|
|
101295
|
-
|
|
101296
|
-
stdin.
|
|
101297
|
-
|
|
101298
|
-
stdin.
|
|
101380
|
+
for (const l of savedData)
|
|
101381
|
+
stdin.addListener("data", l);
|
|
101382
|
+
for (const l of savedKeypress)
|
|
101383
|
+
stdin.addListener("keypress", l);
|
|
101299
101384
|
}
|
|
101300
101385
|
function cancel() {
|
|
101301
101386
|
cleanup();
|
|
@@ -101357,8 +101442,6 @@ function commandPicker(initial) {
|
|
|
101357
101442
|
return;
|
|
101358
101443
|
}
|
|
101359
101444
|
}
|
|
101360
|
-
stdin.setRawMode(true);
|
|
101361
|
-
stdin.resume();
|
|
101362
101445
|
stdin.on("data", onKey);
|
|
101363
101446
|
drawnLines = 0;
|
|
101364
101447
|
draw();
|
|
@@ -101427,13 +101510,18 @@ async function handleSimulate(args, state2) {
|
|
|
101427
101510
|
process.stdout.write(PROMPT);
|
|
101428
101511
|
});
|
|
101429
101512
|
}
|
|
101430
|
-
function interactivePick(title, items) {
|
|
101513
|
+
function interactivePick(title, items, rl) {
|
|
101431
101514
|
return new Promise((resolve) => {
|
|
101432
101515
|
let cursor = items.findIndex((i2) => i2.active) ?? 0;
|
|
101433
101516
|
if (cursor < 0)
|
|
101434
101517
|
cursor = 0;
|
|
101435
101518
|
const stdin = process.stdin;
|
|
101436
|
-
const
|
|
101519
|
+
const savedData = stdin.rawListeners("data").slice();
|
|
101520
|
+
const savedKeypress = stdin.rawListeners("keypress").slice();
|
|
101521
|
+
stdin.removeAllListeners("data");
|
|
101522
|
+
stdin.removeAllListeners("keypress");
|
|
101523
|
+
stdin.resume();
|
|
101524
|
+
stdin.setRawMode(true);
|
|
101437
101525
|
function render2() {
|
|
101438
101526
|
const totalLines = items.length + 4;
|
|
101439
101527
|
process.stdout.write(`\x1B[${totalLines}A\x1B[0J`);
|
|
@@ -101462,10 +101550,10 @@ function interactivePick(title, items) {
|
|
|
101462
101550
|
}
|
|
101463
101551
|
function cleanup() {
|
|
101464
101552
|
stdin.removeListener("data", onKey);
|
|
101465
|
-
|
|
101466
|
-
|
|
101467
|
-
|
|
101468
|
-
|
|
101553
|
+
for (const l of savedData)
|
|
101554
|
+
stdin.addListener("data", l);
|
|
101555
|
+
for (const l of savedKeypress)
|
|
101556
|
+
stdin.addListener("keypress", l);
|
|
101469
101557
|
}
|
|
101470
101558
|
function onKey(data) {
|
|
101471
101559
|
const key = data.toString();
|
|
@@ -101494,8 +101582,6 @@ function interactivePick(title, items) {
|
|
|
101494
101582
|
return;
|
|
101495
101583
|
}
|
|
101496
101584
|
}
|
|
101497
|
-
stdin.setRawMode(true);
|
|
101498
|
-
stdin.resume();
|
|
101499
101585
|
stdin.on("data", onKey);
|
|
101500
101586
|
draw();
|
|
101501
101587
|
});
|
|
@@ -101539,7 +101625,7 @@ async function handleModel(args, state2, rl) {
|
|
|
101539
101625
|
active: name === state2.activeProvider
|
|
101540
101626
|
};
|
|
101541
101627
|
});
|
|
101542
|
-
const chosenProvider = await interactivePick("Select Provider", providerItems);
|
|
101628
|
+
const chosenProvider = await interactivePick("Select Provider", providerItems, rl);
|
|
101543
101629
|
if (!chosenProvider) {
|
|
101544
101630
|
rl.resume();
|
|
101545
101631
|
return;
|
|
@@ -101567,7 +101653,7 @@ async function handleModel(args, state2, rl) {
|
|
|
101567
101653
|
active: id === state2.activeModel && chosenProvider === state2.activeProvider
|
|
101568
101654
|
};
|
|
101569
101655
|
});
|
|
101570
|
-
const chosenModel = await interactivePick("Select Model", modelItems);
|
|
101656
|
+
const chosenModel = await interactivePick("Select Model", modelItems, rl);
|
|
101571
101657
|
if (!chosenModel) {
|
|
101572
101658
|
state2.activeModel = defaultModel;
|
|
101573
101659
|
console.log(source_default.green(" ✓"), `Provider: ${source_default.bold(state2.activeProvider)} Model: ${source_default.bold(state2.activeModel)}`);
|
|
@@ -101979,7 +102065,7 @@ async function startRepl() {
|
|
|
101979
102065
|
if (trimmed2 === "/" || spaceIdx === -1 && !COMMAND_NAMES.includes(cmd)) {
|
|
101980
102066
|
rl.pause();
|
|
101981
102067
|
let skipFinalPrompt = false;
|
|
101982
|
-
commandPicker(trimmed2).then(async (chosen) => {
|
|
102068
|
+
commandPicker(trimmed2, rl).then(async (chosen) => {
|
|
101983
102069
|
if (chosen) {
|
|
101984
102070
|
if (NO_ARG_COMMANDS.has(chosen)) {
|
|
101985
102071
|
await dispatchCommand(chosen, "");
|
|
@@ -102046,7 +102132,7 @@ ${BRAND_BOLD(" ██╔════╝██║ ██║██║██╔
|
|
|
102046
102132
|
${BRAND_BOLD(" ███████╗███████║██║██████╔╝██████╔╝")}
|
|
102047
102133
|
${BRAND_BOLD(" ╚════██║██╔══██║██║██╔═══╝ ██╔══██╗")}
|
|
102048
102134
|
${BRAND_BOLD(" ███████║██║ ██║██║██║ ██║ ██║")}
|
|
102049
|
-
${BRAND_BOLD(" ╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝")}
|
|
102135
|
+
${BRAND_BOLD(" ╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝")} ${DIM2(`v${getVersion()}`)}
|
|
102050
102136
|
`;
|
|
102051
102137
|
});
|
|
102052
102138
|
|
|
@@ -103502,13 +103588,13 @@ async function findActiveMission(cwd2) {
|
|
|
103502
103588
|
}
|
|
103503
103589
|
|
|
103504
103590
|
// src/index.ts
|
|
103505
|
-
function
|
|
103591
|
+
function getVersion2() {
|
|
103506
103592
|
try {
|
|
103507
103593
|
const require2 = createRequire2(import.meta.url);
|
|
103508
103594
|
const pkg = require2("../package.json");
|
|
103509
103595
|
return pkg.version;
|
|
103510
103596
|
} catch {
|
|
103511
|
-
return "
|
|
103597
|
+
return "__SHIPR_VERSION__";
|
|
103512
103598
|
}
|
|
103513
103599
|
}
|
|
103514
103600
|
var hasArgs = process.argv.length > 2;
|
|
@@ -103517,7 +103603,7 @@ if (!hasArgs) {
|
|
|
103517
103603
|
await startRepl2();
|
|
103518
103604
|
} else {
|
|
103519
103605
|
const program2 = new Command;
|
|
103520
|
-
program2.name("shipr").version(
|
|
103606
|
+
program2.name("shipr").version(getVersion2()).description("Fully autonomous terminal-based coding agent");
|
|
103521
103607
|
registerRunCommand(program2);
|
|
103522
103608
|
registerNewCommand(program2);
|
|
103523
103609
|
registerResumeCommand(program2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipr-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Fully autonomous terminal-based coding agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"lint:fix": "bunx biome check src/ --write",
|
|
22
22
|
"test": "bun test",
|
|
23
23
|
"check": "bun run typecheck && bun run lint && bun test",
|
|
24
|
-
"prepublishOnly": "bun run typecheck && bun run build"
|
|
24
|
+
"prepublishOnly": "bun run typecheck && bun run build",
|
|
25
|
+
"postpublish": "npm install -g shipr-agent@latest"
|
|
25
26
|
},
|
|
26
27
|
"keywords": [
|
|
27
28
|
"ai",
|