@agenticcli/shipguard 0.9.0 → 0.10.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/README.md +11 -5
- package/dist/checksum-manifest.json +5 -5
- package/dist/cli-facts.json +3 -3
- package/dist/cli.js +153 -36
- package/package.json +6 -8
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
CLI-first release gate for AI-built apps.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Checks for leaked secrets, auth gaps, payment webhook risks, destructive migrations, and deployment misconfigurations — before your code ships.
|
|
6
6
|
|
|
7
7
|
## 30-second quickstart
|
|
8
8
|
|
|
@@ -84,7 +84,7 @@ outside the ASCII reading, compressed archives, and string tables inside ELF, PE
|
|
|
84
84
|
|
|
85
85
|
## Telemetry
|
|
86
86
|
|
|
87
|
-
Published ShipGuard builds send one pseudonymous usage ping after each scan:
|
|
87
|
+
Published ShipGuard builds send one pseudonymous usage ping after each scan, plus a one-off ping on the first run on an install and one after a successful `shipguard login` (7 keys: `schema`, `event`, `eventId`, `installId`, `cliVersion`, `provenance`, `ci`; the first-run ping is never sent in CI). A scan ping carries 8 keys: `schema`, `eventId`, `installId` (random pseudonym), `cliVersion`, `provenance` (build type), `verdict` (safe / review / blocked / error), `durationBucket` and `ci`. An optional `traffic` key (`test` or `internal`) is added only if you set `SHIPGUARD_TRAFFIC`; any other value is ignored. The install id is a pseudonym stored in `~/.config/shipguard/telemetry.json`; not created or sent in CI, never linked to an account. Never file contents, paths, repo names, branches or commits, or user identity. `shipguard telemetry status` shows what is set, `shipguard telemetry reset` forgets the id (earlier pings can be deleted on request), `SHIPGUARD_TELEMETRY_DEBUG=1` prints the exact payload without sending. Builds from a source checkout never send anything.
|
|
88
88
|
|
|
89
89
|
Before the first ping on a machine, ShipGuard prints a one-line notice to stderr (in every mode, including `--json` and CI, so stdout stays clean). Turn pings off any of these ways:
|
|
90
90
|
|
|
@@ -94,12 +94,18 @@ Before the first ping on a machine, ShipGuard prints a one-line notice to stderr
|
|
|
94
94
|
|
|
95
95
|
To see exactly what would be sent without sending it: `SHIPGUARD_TELEMETRY_DEBUG=1 shipguard scan`.
|
|
96
96
|
|
|
97
|
-
Details: [agenticcli.dev/
|
|
97
|
+
Details: [docs/privacy.md](https://github.com/agenticcli/shipguard/blob/main/docs/privacy.md) and [agenticcli.dev/privacy](https://agenticcli.dev/privacy?utm_source=npm_readme&utm_medium=package&utm_campaign=shipguard_evergreen).
|
|
98
98
|
|
|
99
99
|
## Documentation
|
|
100
100
|
|
|
101
|
-
See [
|
|
101
|
+
See the [ShipGuard docs](https://agenticcli.dev/shipguard/docs?utm_source=npm_readme&utm_medium=package&utm_campaign=shipguard_evergreen) for policy configuration, CI setup, and agent integration. Product page: [agenticcli.dev/shipguard](https://agenticcli.dev/shipguard?utm_source=npm_readme&utm_medium=package&utm_campaign=shipguard_evergreen).
|
|
102
|
+
|
|
103
|
+
## Help
|
|
104
|
+
|
|
105
|
+
- Help, billing, bugs and security reports: support@agenticcli.dev
|
|
106
|
+
- General and press: contact@agenticcli.dev
|
|
107
|
+
- Issues: [github.com/agenticcli/shipguard/issues](https://github.com/agenticcli/shipguard/issues)
|
|
102
108
|
|
|
103
109
|
## License
|
|
104
110
|
|
|
105
|
-
|
|
111
|
+
[Elastic License 2.0](LICENSE). Source-available, free to use commercially; you may not offer it as a hosted service or resell it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"secrets": "
|
|
3
|
-
"auth": "
|
|
4
|
-
"database": "
|
|
5
|
-
"deployment": "
|
|
6
|
-
"payments": "
|
|
2
|
+
"secrets": "8c4d51457fcd41a20e4863b4d3a3ad4437754237515abc2ba8f3c3b229d2c6da",
|
|
3
|
+
"auth": "8c4d51457fcd41a20e4863b4d3a3ad4437754237515abc2ba8f3c3b229d2c6da",
|
|
4
|
+
"database": "8c4d51457fcd41a20e4863b4d3a3ad4437754237515abc2ba8f3c3b229d2c6da",
|
|
5
|
+
"deployment": "8c4d51457fcd41a20e4863b4d3a3ad4437754237515abc2ba8f3c3b229d2c6da",
|
|
6
|
+
"payments": "8c4d51457fcd41a20e4863b4d3a3ad4437754237515abc2ba8f3c3b229d2c6da"
|
|
7
7
|
}
|
package/dist/cli-facts.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.10.0",
|
|
3
3
|
"packageName": "@agenticcli/shipguard",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"licenseDisplay": "ELv2",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"scanIdReused",
|
|
113
113
|
"coverage"
|
|
114
114
|
],
|
|
115
|
-
"schemaVersion": "0.
|
|
115
|
+
"schemaVersion": "0.10",
|
|
116
116
|
"degradeCodes": [
|
|
117
117
|
"FILE_TOO_LARGE",
|
|
118
118
|
"OUTPUT_TRUNCATED",
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
],
|
|
146
146
|
"installSnippet": "npx @agenticcli/shipguard scan --changed --strict --json",
|
|
147
147
|
"re2Engine": true,
|
|
148
|
-
"generatedAt": "2026-11-
|
|
148
|
+
"generatedAt": "2026-11-04T20:46:34.316Z"
|
|
149
149
|
}
|
package/dist/cli.js
CHANGED
|
@@ -3783,6 +3783,7 @@ import { join as join6 } from "path";
|
|
|
3783
3783
|
import YAML2 from "yaml";
|
|
3784
3784
|
var CONFIG_FILE = "telemetry.json";
|
|
3785
3785
|
var NOTICE_MARKER = "telemetry-notice-shown";
|
|
3786
|
+
var FIRST_RUN_MARKER = "telemetry-first-run-sent";
|
|
3786
3787
|
function getConfigDir() {
|
|
3787
3788
|
return join6(homedir2(), ".config", "shipguard");
|
|
3788
3789
|
}
|
|
@@ -3857,6 +3858,19 @@ function markNoticeShown(dir = getConfigDir()) {
|
|
|
3857
3858
|
logger.debug(`telemetry: could not persist the notice marker: ${err instanceof Error ? err.message : String(err)}`);
|
|
3858
3859
|
}
|
|
3859
3860
|
}
|
|
3861
|
+
function firstRunHandled(dir = getConfigDir()) {
|
|
3862
|
+
return existsSync6(join6(dir, FIRST_RUN_MARKER));
|
|
3863
|
+
}
|
|
3864
|
+
function markFirstRunHandled(dir = getConfigDir()) {
|
|
3865
|
+
try {
|
|
3866
|
+
ensureSecureDir(dir);
|
|
3867
|
+
writeSecureFileSync(join6(dir, FIRST_RUN_MARKER), "1\n");
|
|
3868
|
+
return true;
|
|
3869
|
+
} catch (err) {
|
|
3870
|
+
logger.debug(`telemetry: could not persist the first-run marker: ${err instanceof Error ? err.message : String(err)}`);
|
|
3871
|
+
return false;
|
|
3872
|
+
}
|
|
3873
|
+
}
|
|
3860
3874
|
var FALSE_LIKE = /* @__PURE__ */ new Set(["false", "off", "no", "0"]);
|
|
3861
3875
|
var GENERATED_CONFIG_FILE = ".shipguard.yml";
|
|
3862
3876
|
function policyTelemetryEnabled(policy) {
|
|
@@ -3909,6 +3923,11 @@ function resolveEndpoint(published = IS_PUBLISHED_BUILD, env = process.env) {
|
|
|
3909
3923
|
if (published) return override || PROD_TELEMETRY_ENDPOINT;
|
|
3910
3924
|
return isLoopbackUrl(override) ? override : null;
|
|
3911
3925
|
}
|
|
3926
|
+
function resolveTraffic(env, published) {
|
|
3927
|
+
const v = env.SHIPGUARD_TRAFFIC;
|
|
3928
|
+
if (v === "test" || v === "internal") return v;
|
|
3929
|
+
return published ? void 0 : "test";
|
|
3930
|
+
}
|
|
3912
3931
|
var ALLOWED_KEYS = [
|
|
3913
3932
|
"schema",
|
|
3914
3933
|
"eventId",
|
|
@@ -3963,14 +3982,20 @@ function envOptOut(env) {
|
|
|
3963
3982
|
return null;
|
|
3964
3983
|
}
|
|
3965
3984
|
function buildPayload(input) {
|
|
3966
|
-
const { schema, eventId, installId, cliVersion, provenance, verdict, durationBucket: durationBucket2, ci } = input;
|
|
3967
|
-
|
|
3985
|
+
const { schema, eventId, installId, cliVersion, provenance, verdict, durationBucket: durationBucket2, ci, traffic } = input;
|
|
3986
|
+
const out = { schema, eventId, installId, cliVersion, provenance, verdict, durationBucket: durationBucket2, ci };
|
|
3987
|
+
if (traffic === "test" || traffic === "internal") out.traffic = traffic;
|
|
3988
|
+
return out;
|
|
3989
|
+
}
|
|
3990
|
+
function isTrafficOk(obj, count, expected) {
|
|
3991
|
+
if ("traffic" in obj) return count === expected + 1 && (obj.traffic === "test" || obj.traffic === "internal");
|
|
3992
|
+
return count === expected;
|
|
3968
3993
|
}
|
|
3969
3994
|
function validatePayload(payload) {
|
|
3970
3995
|
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) return false;
|
|
3971
3996
|
const obj = payload;
|
|
3972
3997
|
const keys = Object.keys(obj);
|
|
3973
|
-
if (keys.length
|
|
3998
|
+
if (!isTrafficOk(obj, keys.length, ALLOWED_KEYS.length)) return false;
|
|
3974
3999
|
for (const k of ALLOWED_KEYS) if (!(k in obj)) return false;
|
|
3975
4000
|
if (obj.schema !== 2) return false;
|
|
3976
4001
|
if (typeof obj.eventId !== "string" || !UUID_V4.test(obj.eventId)) return false;
|
|
@@ -3997,7 +4022,7 @@ function decideTelemetry(input = {}) {
|
|
|
3997
4022
|
if (projectTelemetryEnabled({ policy: input.policy, projectDir: input.projectDir }) === false) return { enabled: false, source: "project-policy" };
|
|
3998
4023
|
return { enabled: true, source: "default" };
|
|
3999
4024
|
}
|
|
4000
|
-
var NOTICE_TEXT = "shipguard: sends a pseudonymous usage ping after each scan (version, verdict, duration bucket, a random install id outside CI; never code, paths or your account). Turn it off: SHIPGUARD_TELEMETRY=0, DO_NOT_TRACK=1, or `shipguard telemetry disable`. " + goLink("telemetry");
|
|
4025
|
+
var NOTICE_TEXT = "shipguard: sends a pseudonymous usage ping after each scan, once on first run and after login (version, verdict, duration bucket, a random install id outside CI; never code, paths or your account). Turn it off: SHIPGUARD_TELEMETRY=0, DO_NOT_TRACK=1, or `shipguard telemetry disable`. " + goLink("telemetry");
|
|
4001
4026
|
var PING_WAIT_MS = 1500;
|
|
4002
4027
|
var FETCH_TIMEOUT_MS = 1e3;
|
|
4003
4028
|
function debugEnabled(env) {
|
|
@@ -4025,7 +4050,8 @@ function sendTelemetry(input, opts = {}) {
|
|
|
4025
4050
|
provenance: getProvenance(published),
|
|
4026
4051
|
verdict: input.verdict,
|
|
4027
4052
|
durationBucket: durationBucket(input.durationMs),
|
|
4028
|
-
ci
|
|
4053
|
+
ci,
|
|
4054
|
+
traffic: resolveTraffic(env, published)
|
|
4029
4055
|
};
|
|
4030
4056
|
if (debug) {
|
|
4031
4057
|
const stored = ci ? null : readInstallId(configDir);
|
|
@@ -4056,27 +4082,113 @@ function sendTelemetry(input, opts = {}) {
|
|
|
4056
4082
|
return Promise.resolve();
|
|
4057
4083
|
}
|
|
4058
4084
|
const body = JSON.stringify(payload);
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4085
|
+
return postBounded(endpoint, body);
|
|
4086
|
+
} catch (err) {
|
|
4087
|
+
logger.debug(`telemetry: skipped after error (ignored): ${err instanceof Error ? err.message : String(err)}`);
|
|
4088
|
+
return Promise.resolve();
|
|
4089
|
+
}
|
|
4090
|
+
}
|
|
4091
|
+
function postBounded(endpoint, body) {
|
|
4092
|
+
const controller = new AbortController();
|
|
4093
|
+
const abortTimer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
4094
|
+
const request = fetch(endpoint, {
|
|
4095
|
+
method: "POST",
|
|
4096
|
+
headers: { "Content-Type": "application/json" },
|
|
4097
|
+
body,
|
|
4098
|
+
signal: controller.signal
|
|
4099
|
+
}).then(
|
|
4100
|
+
() => void 0,
|
|
4101
|
+
(err) => {
|
|
4102
|
+
logger.debug(`telemetry: ping failed (ignored): ${err instanceof Error ? err.message : String(err)}`);
|
|
4103
|
+
}
|
|
4104
|
+
).finally(() => clearTimeout(abortTimer));
|
|
4105
|
+
return new Promise((resolve7) => {
|
|
4106
|
+
const cap = setTimeout(resolve7, PING_WAIT_MS);
|
|
4107
|
+
cap.unref();
|
|
4108
|
+
void request.then(() => {
|
|
4109
|
+
clearTimeout(cap);
|
|
4110
|
+
resolve7();
|
|
4079
4111
|
});
|
|
4112
|
+
});
|
|
4113
|
+
}
|
|
4114
|
+
var CLI_VERSION = true ? "0.10.0" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
4115
|
+
var LIFECYCLE_KEYS = ["schema", "event", "eventId", "installId", "cliVersion", "provenance", "ci"];
|
|
4116
|
+
function validateLifecyclePayload(payload) {
|
|
4117
|
+
if (typeof payload !== "object" || payload === null || Array.isArray(payload)) return false;
|
|
4118
|
+
const o = payload;
|
|
4119
|
+
const keys = Object.keys(o);
|
|
4120
|
+
if (!isTrafficOk(o, keys.length, LIFECYCLE_KEYS.length) || !LIFECYCLE_KEYS.every((k) => k in o)) return false;
|
|
4121
|
+
if (o.schema !== 3) return false;
|
|
4122
|
+
if (o.event !== "cli_first_run" && o.event !== "cli_login") return false;
|
|
4123
|
+
if (typeof o.eventId !== "string" || !UUID_V4.test(o.eventId)) return false;
|
|
4124
|
+
if (typeof o.ci !== "boolean") return false;
|
|
4125
|
+
if (o.ci) {
|
|
4126
|
+
if (o.installId !== null || o.event === "cli_first_run") return false;
|
|
4127
|
+
} else if (typeof o.installId !== "string" || !UUID_V4.test(o.installId)) {
|
|
4128
|
+
return false;
|
|
4129
|
+
}
|
|
4130
|
+
if (typeof o.cliVersion !== "string" || o.cliVersion.length > 40 || !VERSION_RE.test(o.cliVersion)) return false;
|
|
4131
|
+
return o.provenance === "published" || o.provenance === "dev";
|
|
4132
|
+
}
|
|
4133
|
+
function sendLifecycleEvent(event, input, opts = {}) {
|
|
4134
|
+
try {
|
|
4135
|
+
const env = opts.env ?? process.env;
|
|
4136
|
+
const configDir = opts.configDir ?? getConfigDir();
|
|
4137
|
+
const published = opts.published ?? IS_PUBLISHED_BUILD;
|
|
4138
|
+
const debug = debugEnabled(env);
|
|
4139
|
+
const ci = detectCi(env);
|
|
4140
|
+
if (event === "cli_first_run" && ci) return Promise.resolve();
|
|
4141
|
+
const decision = decideTelemetry({ env, configDir, policy: opts.policy, projectDir: opts.projectDir });
|
|
4142
|
+
if (!decision.enabled) {
|
|
4143
|
+
if (debug) process.stderr.write(`[shipguard:telemetry] disabled (${decision.source}); nothing would be sent
|
|
4144
|
+
`);
|
|
4145
|
+
return Promise.resolve();
|
|
4146
|
+
}
|
|
4147
|
+
const endpoint = resolveEndpoint(published, env);
|
|
4148
|
+
const base = {
|
|
4149
|
+
schema: 3,
|
|
4150
|
+
event,
|
|
4151
|
+
eventId: randomUUID5(),
|
|
4152
|
+
cliVersion: input.cliVersion,
|
|
4153
|
+
provenance: getProvenance(published),
|
|
4154
|
+
ci
|
|
4155
|
+
};
|
|
4156
|
+
const traffic = resolveTraffic(env, published);
|
|
4157
|
+
if (debug) {
|
|
4158
|
+
const installId2 = ci ? null : readInstallId(configDir) ?? randomUUID5();
|
|
4159
|
+
process.stderr.write(
|
|
4160
|
+
`[shipguard:telemetry] SHIPGUARD_TELEMETRY_DEBUG=1: not sending. endpoint=${endpoint ?? "(none)"} payload=${JSON.stringify({ ...base, installId: installId2, ...traffic ? { traffic } : {} })}
|
|
4161
|
+
`
|
|
4162
|
+
);
|
|
4163
|
+
return Promise.resolve();
|
|
4164
|
+
}
|
|
4165
|
+
if (endpoint === null) {
|
|
4166
|
+
logger.debug("telemetry: dev build, not sending (set a loopback SHIPGUARD_TELEMETRY_URL to capture)");
|
|
4167
|
+
return Promise.resolve();
|
|
4168
|
+
}
|
|
4169
|
+
if (event === "cli_first_run") {
|
|
4170
|
+
if (firstRunHandled(configDir)) return Promise.resolve();
|
|
4171
|
+
if (readInstallId(configDir)) {
|
|
4172
|
+
markFirstRunHandled(configDir);
|
|
4173
|
+
return Promise.resolve();
|
|
4174
|
+
}
|
|
4175
|
+
}
|
|
4176
|
+
if (!noticeShown(configDir)) {
|
|
4177
|
+
process.stderr.write(NOTICE_TEXT + "\n");
|
|
4178
|
+
markNoticeShown(configDir);
|
|
4179
|
+
}
|
|
4180
|
+
const installId = ci ? null : getOrCreateInstallId(configDir) ?? void 0;
|
|
4181
|
+
if (installId === void 0) {
|
|
4182
|
+
logger.debug("telemetry: no install id could be saved; not sending");
|
|
4183
|
+
return Promise.resolve();
|
|
4184
|
+
}
|
|
4185
|
+
if (event === "cli_first_run" && !markFirstRunHandled(configDir)) return Promise.resolve();
|
|
4186
|
+
const payload = { ...base, installId, ...traffic ? { traffic } : {} };
|
|
4187
|
+
if (!validateLifecyclePayload(payload)) {
|
|
4188
|
+
logger.debug("telemetry: lifecycle payload failed validation; not sending");
|
|
4189
|
+
return Promise.resolve();
|
|
4190
|
+
}
|
|
4191
|
+
return postBounded(endpoint, JSON.stringify(payload));
|
|
4080
4192
|
} catch (err) {
|
|
4081
4193
|
logger.debug(`telemetry: skipped after error (ignored): ${err instanceof Error ? err.message : String(err)}`);
|
|
4082
4194
|
return Promise.resolve();
|
|
@@ -4120,7 +4232,7 @@ function exitWhenDrained() {
|
|
|
4120
4232
|
|
|
4121
4233
|
// src/commands/scan.ts
|
|
4122
4234
|
var LEARN_MORE = `Docs ${goLink("docs")} \xB7 Site ${goLink("site")} \xB7 Pricing ${goLink("pricing")} \xB7 Issues https://github.com/agenticcli/shipguard/issues`;
|
|
4123
|
-
var
|
|
4235
|
+
var CLI_VERSION2 = true ? "0.10.0" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
4124
4236
|
function resolveExitCode(opts) {
|
|
4125
4237
|
if (opts.strict && (opts.blockingCount > 0 || opts.degraded === true || opts.recommendation === "DO_NOT_SHIP")) {
|
|
4126
4238
|
return EXIT_CODES.BLOCKED;
|
|
@@ -4253,7 +4365,7 @@ ${LEARN_MORE}`);
|
|
|
4253
4365
|
async function exitWithError(exitCode, startTime, projectDir, policy) {
|
|
4254
4366
|
try {
|
|
4255
4367
|
await sendTelemetry(
|
|
4256
|
-
{ cliVersion:
|
|
4368
|
+
{ cliVersion: CLI_VERSION2, verdict: "error", durationMs: Date.now() - startTime },
|
|
4257
4369
|
{ policy, projectDir }
|
|
4258
4370
|
);
|
|
4259
4371
|
} catch (err) {
|
|
@@ -4296,7 +4408,7 @@ async function runScan(ctx) {
|
|
|
4296
4408
|
const { scanId, scanIdReused } = await resolveScanId({
|
|
4297
4409
|
cwd,
|
|
4298
4410
|
policy,
|
|
4299
|
-
cliVersion:
|
|
4411
|
+
cliVersion: CLI_VERSION2,
|
|
4300
4412
|
changedOnly,
|
|
4301
4413
|
categories,
|
|
4302
4414
|
proRequested: Boolean(opts.pro),
|
|
@@ -4471,7 +4583,7 @@ async function runScan(ctx) {
|
|
|
4471
4583
|
result.creditsWarning = creditsRemaining !== void 0 && creditsRemaining < 10;
|
|
4472
4584
|
result.rulesVersion = rulesVersion;
|
|
4473
4585
|
result.runId = scanId;
|
|
4474
|
-
result.cliVersion =
|
|
4586
|
+
result.cliVersion = CLI_VERSION2;
|
|
4475
4587
|
applyVerdict(result);
|
|
4476
4588
|
if (proRules?.length) {
|
|
4477
4589
|
const breakdown = {};
|
|
@@ -4486,7 +4598,7 @@ async function runScan(ctx) {
|
|
|
4486
4598
|
const historyOutcome = await recordScanHistory({
|
|
4487
4599
|
cwd,
|
|
4488
4600
|
scanId,
|
|
4489
|
-
cliVersion:
|
|
4601
|
+
cliVersion: CLI_VERSION2,
|
|
4490
4602
|
policy,
|
|
4491
4603
|
changedOnly: scanOptions.changedOnly,
|
|
4492
4604
|
categories,
|
|
@@ -4612,7 +4724,7 @@ async function runScan(ctx) {
|
|
|
4612
4724
|
const verdictBucket = result.degraded ? "review" : result.riskScore.blockingCount > 0 ? "blocked" : result.riskScore.recommendation === "REVIEW_BEFORE_SHIP" ? "review" : "safe";
|
|
4613
4725
|
telemetryDone = sendTelemetry(
|
|
4614
4726
|
{
|
|
4615
|
-
cliVersion:
|
|
4727
|
+
cliVersion: CLI_VERSION2,
|
|
4616
4728
|
verdict: verdictBucket,
|
|
4617
4729
|
durationMs: elapsedMs
|
|
4618
4730
|
},
|
|
@@ -4751,6 +4863,7 @@ Visit: ${safeUrl.href}`);
|
|
|
4751
4863
|
apiUrl
|
|
4752
4864
|
});
|
|
4753
4865
|
logger.success("Authenticated successfully!");
|
|
4866
|
+
await sendLifecycleEvent("cli_login", { cliVersion: CLI_VERSION }, { projectDir: process.cwd() });
|
|
4754
4867
|
return;
|
|
4755
4868
|
}
|
|
4756
4869
|
const { error } = tokenBody;
|
|
@@ -4814,7 +4927,7 @@ function statusCommand() {
|
|
|
4814
4927
|
// src/commands/history.ts
|
|
4815
4928
|
import { Command as Command6 } from "commander";
|
|
4816
4929
|
import { resolve as resolve5 } from "path";
|
|
4817
|
-
var
|
|
4930
|
+
var CLI_VERSION3 = true ? "0.10.0" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
4818
4931
|
function historyCommand() {
|
|
4819
4932
|
return new Command6("history").description("Show recent local scan history for this repo (read-only; --json for machine output)").argument("[path]", "Path to project root (defaults to current directory)").option("--json", "Output as JSON").option("--limit <n>", "Number of recent scans to show", (v) => Number.parseInt(v, 10) || 10, 10).action(async (scanPath, opts) => {
|
|
4820
4933
|
const cwd = scanPath ? resolve5(scanPath) : process.cwd();
|
|
@@ -4829,7 +4942,7 @@ function historyCommand() {
|
|
|
4829
4942
|
}
|
|
4830
4943
|
const identity = resolveRepoIdentity(cwd);
|
|
4831
4944
|
const historyPath = resolveHistoryPath(cwd, policy);
|
|
4832
|
-
const openResult = await HistoryStore.open(historyPath,
|
|
4945
|
+
const openResult = await HistoryStore.open(historyPath, CLI_VERSION3);
|
|
4833
4946
|
if (!openResult.ok) {
|
|
4834
4947
|
if (machineOutput) {
|
|
4835
4948
|
console.log(JSON.stringify({ version: 1, available: false, status: openResult.status, reason: openResult.reason }));
|
|
@@ -5136,13 +5249,13 @@ Exit codes:
|
|
|
5136
5249
|
|
|
5137
5250
|
// src/commands/schema.ts
|
|
5138
5251
|
import { Command as Command8 } from "commander";
|
|
5139
|
-
var
|
|
5252
|
+
var CLI_VERSION4 = true ? "0.10.0" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
5140
5253
|
var CURRENT_SCHEMA_VERSION2 = "6";
|
|
5141
5254
|
function buildSchemaContract(limits) {
|
|
5142
5255
|
const src = (value, fallback) => value === fallback ? "default" : "policy";
|
|
5143
5256
|
return {
|
|
5144
5257
|
schemaVersion: CURRENT_SCHEMA_VERSION2,
|
|
5145
|
-
cliVersion:
|
|
5258
|
+
cliVersion: CLI_VERSION4,
|
|
5146
5259
|
contract: "shipguard-scan-result",
|
|
5147
5260
|
recommendation: {
|
|
5148
5261
|
field: "recommendation",
|
|
@@ -5517,13 +5630,17 @@ if (rawArgs[0] === "?") {
|
|
|
5517
5630
|
process.argv = [process.argv[0], process.argv[1], "help"];
|
|
5518
5631
|
}
|
|
5519
5632
|
program.name("shipguard").description("CLI-first release gate for AI-built apps").version(
|
|
5520
|
-
true ? "0.
|
|
5633
|
+
true ? "0.10.0" : process.env.npm_package_version ?? "0.0.0-dev"
|
|
5521
5634
|
).helpCommand(false).addHelpText("after", `
|
|
5522
5635
|
Learn more:
|
|
5523
5636
|
Docs ${goLink("docs")}
|
|
5524
5637
|
Site ${goLink("site")}
|
|
5525
5638
|
Pricing ${goLink("pricing")}
|
|
5526
5639
|
Issues ${ISSUES_URL4}`);
|
|
5640
|
+
program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
5641
|
+
if (actionCommand.name() === "telemetry" || actionCommand.parent?.name() === "telemetry") return;
|
|
5642
|
+
await sendLifecycleEvent("cli_first_run", { cliVersion: CLI_VERSION }, { projectDir: process.cwd() });
|
|
5643
|
+
});
|
|
5527
5644
|
program.exitOverride();
|
|
5528
5645
|
function addSubcommand(cmd) {
|
|
5529
5646
|
cmd.exitOverride();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticcli/shipguard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "CLI-first release gate for AI-built apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli.js",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@noble/hashes": "^2.
|
|
18
|
+
"@noble/hashes": "^2.4.0",
|
|
19
19
|
"chalk": "^5.4.0",
|
|
20
20
|
"commander": "^13.1.0",
|
|
21
21
|
"fast-glob": "^3.3.0",
|
|
22
|
-
"jose": "^6.2.
|
|
23
|
-
"minimatch": "^
|
|
22
|
+
"jose": "^6.2.13",
|
|
23
|
+
"minimatch": "^11.0.1",
|
|
24
24
|
"re2js": "2.8.3",
|
|
25
|
-
"yaml": "^2.
|
|
25
|
+
"yaml": "^2.9.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.0.0",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"agenticcli",
|
|
41
41
|
"release-gate",
|
|
42
42
|
"ai-code",
|
|
43
|
-
"security",
|
|
44
43
|
"cli",
|
|
45
44
|
"ai-agents",
|
|
46
45
|
"claude-code",
|
|
@@ -48,11 +47,10 @@
|
|
|
48
47
|
"codex",
|
|
49
48
|
"agentic",
|
|
50
49
|
"pre-deploy-check",
|
|
51
|
-
"secrets-scanner",
|
|
52
50
|
"llm-generated-code"
|
|
53
51
|
],
|
|
54
52
|
"license": "Elastic-2.0",
|
|
55
|
-
"author": "
|
|
53
|
+
"author": "AgenticCLI",
|
|
56
54
|
"repository": {
|
|
57
55
|
"type": "git",
|
|
58
56
|
"url": "git+https://github.com/agenticcli/shipguard.git"
|