@the-vibe-company/armada 0.2.20 → 0.2.21
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/armada.js +30 -21
- package/package.json +1 -1
package/dist/armada.js
CHANGED
|
@@ -1758,8 +1758,6 @@ function notStartedBody(l, now) {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
var notStartedLaunches = (launches, now, minutes) => followedLaunches(launches, now).filter((l) => now.getTime() - Date.parse(l.launchedAt) > minutes * MIN2);
|
|
1760
1760
|
|
|
1761
|
-
// ../core/src/activity.ts
|
|
1762
|
-
var SAME_MS = 10 * 60000;
|
|
1763
1761
|
// ../core/src/linear.ts
|
|
1764
1762
|
var LINEAR_ENDPOINT = "https://api.linear.app/graphql";
|
|
1765
1763
|
var MAX_DEPTH = 8;
|
|
@@ -2386,6 +2384,7 @@ async function waitForApproval({ api, code, sleep, now }) {
|
|
|
2386
2384
|
}
|
|
2387
2385
|
throw new ArmadaApiError("the code expired before it was approved", LOGIN_NEXT);
|
|
2388
2386
|
}
|
|
2387
|
+
|
|
2389
2388
|
// ../core/src/attachments.ts
|
|
2390
2389
|
var MAX_ATTACHMENT_BYTES = 2 * 1024 * 1024;
|
|
2391
2390
|
function attachmentImageType(bytes) {
|
|
@@ -2425,6 +2424,7 @@ function checkAttachment(input) {
|
|
|
2425
2424
|
return "attachment link type limit: a valid HTTPS URL is required";
|
|
2426
2425
|
}
|
|
2427
2426
|
}
|
|
2427
|
+
|
|
2428
2428
|
// ../core/src/phases.ts
|
|
2429
2429
|
var TRANSITIONS = {
|
|
2430
2430
|
planning: ["awaiting-approval", "implementing"],
|
|
@@ -3300,6 +3300,7 @@ async function loadBrief(config, opts) {
|
|
|
3300
3300
|
async function launchForBrief(ticket, launch) {
|
|
3301
3301
|
return ticket.statusType !== "completed" && ticket.statusType !== "canceled" && launch ? launch(ticket.id) : null;
|
|
3302
3302
|
}
|
|
3303
|
+
|
|
3303
3304
|
// ../core/src/credentials.ts
|
|
3304
3305
|
var DEFAULT_ARMADA_API_URL = "https://armada.thevibecompany.co";
|
|
3305
3306
|
var SESSION_TOKEN_VARIABLE = "ARMADA_SESSION_TOKEN";
|
|
@@ -3412,6 +3413,7 @@ var missingKeys = (credentials) => STORED_KEYS.filter((k) => credentials[k.name]
|
|
|
3412
3413
|
function missingKeyMessage(key) {
|
|
3413
3414
|
return `${key.variable} is not set. Set it in the environment, run \`armada auth login\` to store it on this machine (${key.hint}), or sign in with \`armada login\` to an Armada that keeps your organization's keys.`;
|
|
3414
3415
|
}
|
|
3416
|
+
|
|
3415
3417
|
// ../core/src/dotenv.ts
|
|
3416
3418
|
var ASSIGNMENT = /^\s*(export\s+)?([A-Za-z_][A-Za-z0-9_]*)=(.*)$/;
|
|
3417
3419
|
function shellWord2(raw) {
|
|
@@ -3524,6 +3526,7 @@ function updateDotenv(text, updates) {
|
|
|
3524
3526
|
`)}
|
|
3525
3527
|
` : "";
|
|
3526
3528
|
}
|
|
3529
|
+
|
|
3527
3530
|
// ../core/src/fleet-api.ts
|
|
3528
3531
|
var WORKER_FLEET_OPS = ["claim", "report", "ask", "release", "heartbeat"];
|
|
3529
3532
|
var FLEET_OPS = [
|
|
@@ -3580,6 +3583,7 @@ function fleetClient(o) {
|
|
|
3580
3583
|
})
|
|
3581
3584
|
};
|
|
3582
3585
|
}
|
|
3586
|
+
|
|
3583
3587
|
// ../core/src/github.ts
|
|
3584
3588
|
var GITHUB_GRAPHQL = "https://api.github.com/graphql";
|
|
3585
3589
|
|
|
@@ -3837,6 +3841,7 @@ async function fetchCommit(opts) {
|
|
|
3837
3841
|
return null;
|
|
3838
3842
|
return { sha: c.oid, tree: c.tree.oid, parents: c.parents.nodes.map((p) => p.oid) };
|
|
3839
3843
|
}
|
|
3844
|
+
|
|
3840
3845
|
// ../core/src/heartbeat.ts
|
|
3841
3846
|
async function heartbeatLoop(options) {
|
|
3842
3847
|
let claimedAt = null;
|
|
@@ -3865,6 +3870,7 @@ async function heartbeatLoop(options) {
|
|
|
3865
3870
|
}
|
|
3866
3871
|
return "parent-exited";
|
|
3867
3872
|
}
|
|
3873
|
+
|
|
3868
3874
|
// ../core/src/inbox.ts
|
|
3869
3875
|
function questionBody(question, options = []) {
|
|
3870
3876
|
const listed = options.map((o) => o.trim()).filter(Boolean);
|
|
@@ -4030,6 +4036,7 @@ async function declineLaunch(ctx, item, reason, warnings) {
|
|
|
4030
4036
|
];
|
|
4031
4037
|
return { ticket: item.ticket ?? `#${item.id}`, url: "", lines, warnings: [...new Set(warnings)], inbox: null };
|
|
4032
4038
|
}
|
|
4039
|
+
|
|
4033
4040
|
// ../core/src/labels.ts
|
|
4034
4041
|
function requiredLabels(config) {
|
|
4035
4042
|
return [
|
|
@@ -4119,6 +4126,7 @@ async function createMissingLabels(state, opts) {
|
|
|
4119
4126
|
}
|
|
4120
4127
|
return created;
|
|
4121
4128
|
}
|
|
4129
|
+
|
|
4122
4130
|
// ../core/src/linear-write.ts
|
|
4123
4131
|
var LABEL = "id name parent { name }";
|
|
4124
4132
|
var ATTACHMENT = "title url";
|
|
@@ -4259,6 +4267,7 @@ function createLinearWriter(opts) {
|
|
|
4259
4267
|
}
|
|
4260
4268
|
};
|
|
4261
4269
|
}
|
|
4270
|
+
|
|
4262
4271
|
// ../core/src/machine.ts
|
|
4263
4272
|
import { randomBytes } from "node:crypto";
|
|
4264
4273
|
import { chmod, link, mkdir, open, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
@@ -4636,6 +4645,7 @@ async function addNoticedRelease(paths, version) {
|
|
|
4636
4645
|
`;
|
|
4637
4646
|
await writePrivate(paths, releasesFile(paths), text, 420);
|
|
4638
4647
|
}
|
|
4648
|
+
|
|
4639
4649
|
// ../core/src/merge.ts
|
|
4640
4650
|
var MERGE_LEASE = "merge";
|
|
4641
4651
|
var MERGE_LEASE_TTL_MS = 20 * 60000;
|
|
@@ -5284,10 +5294,7 @@ function outcome(c, merged, pr, lines, workers, archive) {
|
|
|
5284
5294
|
warnings: c.warnings
|
|
5285
5295
|
};
|
|
5286
5296
|
}
|
|
5287
|
-
|
|
5288
|
-
var SAME_REPORT_MS = 2 * 60000;
|
|
5289
|
-
var MIN3 = 60000;
|
|
5290
|
-
var HOUR = 60 * MIN3;
|
|
5297
|
+
|
|
5291
5298
|
// ../core/src/projects.ts
|
|
5292
5299
|
var message = (err) => err instanceof Error ? err.message : String(err);
|
|
5293
5300
|
async function readProjectConfig(p, opts) {
|
|
@@ -5311,6 +5318,7 @@ async function readProjectConfig(p, opts) {
|
|
|
5311
5318
|
return fallback(message(err));
|
|
5312
5319
|
}
|
|
5313
5320
|
}
|
|
5321
|
+
|
|
5314
5322
|
// ../core/src/skills.ts
|
|
5315
5323
|
import { createHash as createHash2 } from "node:crypto";
|
|
5316
5324
|
|
|
@@ -5905,6 +5913,7 @@ ${SHIP_ARTIFACTS}
|
|
|
5905
5913
|
return plan;
|
|
5906
5914
|
}
|
|
5907
5915
|
var planIsEmpty = (p) => !p.writes.length && !p.removes.length && !p.links.length;
|
|
5916
|
+
|
|
5908
5917
|
// ../core/src/status.ts
|
|
5909
5918
|
var STATUS_SCHEMA_VERSION = 1;
|
|
5910
5919
|
function routeOf(config, labels) {
|
|
@@ -6064,7 +6073,7 @@ async function loadStatus(config, opts) {
|
|
|
6064
6073
|
});
|
|
6065
6074
|
}
|
|
6066
6075
|
// package.json
|
|
6067
|
-
var version = "0.2.
|
|
6076
|
+
var version = "0.2.21";
|
|
6068
6077
|
|
|
6069
6078
|
// src/attach.ts
|
|
6070
6079
|
import { resolve } from "node:path";
|
|
@@ -6895,7 +6904,7 @@ function renderInbox(r, next) {
|
|
|
6895
6904
|
`)}
|
|
6896
6905
|
`;
|
|
6897
6906
|
}
|
|
6898
|
-
async function
|
|
6907
|
+
async function inbox(io, config, credentials, a) {
|
|
6899
6908
|
if (a.rest.length)
|
|
6900
6909
|
throw new UsageError(`unexpected argument ${a.rest[0]}`);
|
|
6901
6910
|
const wait = a.options.wait === "true";
|
|
@@ -7004,7 +7013,7 @@ var shown = (io, items, inFlight) => ({
|
|
|
7004
7013
|
...inFlight ? { inFlight, readAt: now(io).toISOString() } : {},
|
|
7005
7014
|
stopped: null
|
|
7006
7015
|
});
|
|
7007
|
-
async function
|
|
7016
|
+
async function watch(io, config, credentials, a, configPath) {
|
|
7008
7017
|
if (a.rest.length)
|
|
7009
7018
|
throw new UsageError(`unexpected argument ${a.rest[0]}`);
|
|
7010
7019
|
const project = config.project.slug;
|
|
@@ -7178,7 +7187,7 @@ function launcher(io, config, credentials) {
|
|
|
7178
7187
|
}
|
|
7179
7188
|
};
|
|
7180
7189
|
}
|
|
7181
|
-
async function
|
|
7190
|
+
async function brief(io, config, credentials, a, version, configPath) {
|
|
7182
7191
|
const [ticket, ...extra] = a.rest;
|
|
7183
7192
|
if (!ticket)
|
|
7184
7193
|
throw new UsageError('brief needs a ticket: armada brief <ticket> [--profile <name> [--reason "<why>"]]');
|
|
@@ -7617,7 +7626,7 @@ async function doctor(io, json, armadaVersion) {
|
|
|
7617
7626
|
|
|
7618
7627
|
// src/heartbeat.ts
|
|
7619
7628
|
import { createHash as createHash3 } from "node:crypto";
|
|
7620
|
-
async function
|
|
7629
|
+
async function heartbeat(io, config, credentials, args) {
|
|
7621
7630
|
if (args.rest.length)
|
|
7622
7631
|
throw new UsageError("heartbeat takes no positional argument");
|
|
7623
7632
|
const interval = args.options.every ?? "5m";
|
|
@@ -8093,7 +8102,7 @@ function render(o) {
|
|
|
8093
8102
|
`)}
|
|
8094
8103
|
`;
|
|
8095
8104
|
}
|
|
8096
|
-
async function
|
|
8105
|
+
async function merge(io, config, credentials, a, configPath) {
|
|
8097
8106
|
const [arg, ...extra] = a.rest;
|
|
8098
8107
|
if (extra.length)
|
|
8099
8108
|
throw new UsageError(`unexpected argument ${extra[0]}`);
|
|
@@ -8181,10 +8190,10 @@ async function merge2(io, config, credentials, a, configPath) {
|
|
|
8181
8190
|
}
|
|
8182
8191
|
|
|
8183
8192
|
// src/render.ts
|
|
8184
|
-
var
|
|
8193
|
+
var MIN3 = 60000;
|
|
8185
8194
|
function relative2(iso, now) {
|
|
8186
8195
|
const diff = now - Date.parse(iso);
|
|
8187
|
-
const m = Math.round(Math.abs(diff) /
|
|
8196
|
+
const m = Math.round(Math.abs(diff) / MIN3);
|
|
8188
8197
|
const suffix = diff >= 0 ? "ago" : "from now";
|
|
8189
8198
|
if (m < 1)
|
|
8190
8199
|
return "just now";
|
|
@@ -8900,7 +8909,7 @@ async function findConfig(io, explicit, command = "status") {
|
|
|
8900
8909
|
}
|
|
8901
8910
|
throw new UsageError(`no ${CONFIG_FILE} found in ${io.cwd} or any parent directory, so this is not a repository Armada runs`, `armada init to set this repository up, armada ${command} --config <file> to use another ${CONFIG_FILE}, or armada status --all to see the registered projects`);
|
|
8902
8911
|
}
|
|
8903
|
-
async function
|
|
8912
|
+
async function status(io, args) {
|
|
8904
8913
|
const { path, text } = await findConfig(io, args.config, "status");
|
|
8905
8914
|
const config = parseConfig(text, path);
|
|
8906
8915
|
const { credentials } = await loadCredentials(io, { project: config.project.slug });
|
|
@@ -9022,9 +9031,9 @@ async function dispatch(argv, io) {
|
|
|
9022
9031
|
ticket: (stored) => currentTicket(io, config, args.options.ticket, stored)
|
|
9023
9032
|
}
|
|
9024
9033
|
});
|
|
9025
|
-
return await
|
|
9034
|
+
return await heartbeat(io, config, credentials, args);
|
|
9026
9035
|
}
|
|
9027
|
-
const worker = { claim, report, release, ask, inbox
|
|
9036
|
+
const worker = { claim, report, release, ask, inbox, answer }[args.command];
|
|
9028
9037
|
if (worker) {
|
|
9029
9038
|
const { path, text } = await findConfig(io, args.config, args.command);
|
|
9030
9039
|
const config = parseConfig(text, path);
|
|
@@ -9044,7 +9053,7 @@ async function dispatch(argv, io) {
|
|
|
9044
9053
|
const config = parseConfig(text, path);
|
|
9045
9054
|
const { credentials } = await loadCredentials(io, { project: config.project.slug });
|
|
9046
9055
|
await recordPresence(io, config, credentials);
|
|
9047
|
-
return await
|
|
9056
|
+
return await watch(io, config, credentials, args, path);
|
|
9048
9057
|
}
|
|
9049
9058
|
if (args.command === "hook")
|
|
9050
9059
|
return await hookStop(io, args.rest, (at) => findConfig(at, null, "hook"));
|
|
@@ -9053,7 +9062,7 @@ async function dispatch(argv, io) {
|
|
|
9053
9062
|
const config = parseConfig(text, path);
|
|
9054
9063
|
const { credentials } = await loadCredentials(io, { project: config.project.slug });
|
|
9055
9064
|
await recordPresence(io, config, credentials);
|
|
9056
|
-
return await
|
|
9065
|
+
return await merge(io, config, credentials, args, path);
|
|
9057
9066
|
}
|
|
9058
9067
|
if (args.command === "brief") {
|
|
9059
9068
|
const { path, text } = await findConfig(io, args.config, "brief");
|
|
@@ -9061,7 +9070,7 @@ async function dispatch(argv, io) {
|
|
|
9061
9070
|
const { credentials } = await loadCredentials(io, { project: config.project.slug });
|
|
9062
9071
|
if (args.options.prompt === "true")
|
|
9063
9072
|
await recordPresence(io, config, credentials);
|
|
9064
|
-
return await
|
|
9073
|
+
return await brief(io, config, credentials, args, version, path);
|
|
9065
9074
|
}
|
|
9066
9075
|
if (args.command === "launch") {
|
|
9067
9076
|
const { path, text } = await findConfig(io, args.config, "launch");
|
|
@@ -9071,7 +9080,7 @@ async function dispatch(argv, io) {
|
|
|
9071
9080
|
}
|
|
9072
9081
|
if (args.command === "status") {
|
|
9073
9082
|
noExtra(args.rest);
|
|
9074
|
-
return await (args.all ? statusAll(io, args.json) :
|
|
9083
|
+
return await (args.all ? statusAll(io, args.json) : status(io, args));
|
|
9075
9084
|
}
|
|
9076
9085
|
if (args.command === "doctor") {
|
|
9077
9086
|
noExtra(args.rest);
|