@warmhub/cli 0.146.0 → 0.148.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/wh.js +176 -44
- package/package.json +1 -1
package/dist/wh.js
CHANGED
|
@@ -18538,6 +18538,9 @@ function decodeDurableId(token) {
|
|
|
18538
18538
|
thingId: bytesToUuid(payload, UUID_BYTES)
|
|
18539
18539
|
};
|
|
18540
18540
|
}
|
|
18541
|
+
function isDurableId(token) {
|
|
18542
|
+
return decodeDurableId(token) !== null;
|
|
18543
|
+
}
|
|
18541
18544
|
var VERSION_SELECTOR_RE = /^(?:v0*[1-9]\d*|[Hh][Ee][Aa][Dd]|[Aa][Ll][Ll])$/;
|
|
18542
18545
|
function parseDurableReferenceToken(raw) {
|
|
18543
18546
|
const at = raw.lastIndexOf("@");
|
|
@@ -18577,7 +18580,7 @@ function isReservedShapeName(name) {
|
|
|
18577
18580
|
return name === RESERVED_THING_ROOT;
|
|
18578
18581
|
}
|
|
18579
18582
|
function reservedThingRootMessage(name) {
|
|
18580
|
-
return `Name "${name}" is under the reserved root "${RESERVED_THING_ROOT_PREFIX}"; only
|
|
18583
|
+
return `Name "${name}" is under the reserved root "${RESERVED_THING_ROOT_PREFIX}"; only platform-owned names may live there, including ${RESERVED_THING_ROOT_PREFIX}shapes/<Name> and ${RESERVED_THING_ROOT_PREFIX}redacted/<durable-id>`;
|
|
18581
18584
|
}
|
|
18582
18585
|
|
|
18583
18586
|
// ../../packages/rules/src/wref.ts
|
|
@@ -18754,11 +18757,13 @@ var COMMIT_OPERATIONS = [
|
|
|
18754
18757
|
"retract",
|
|
18755
18758
|
"reaffirm",
|
|
18756
18759
|
"rename",
|
|
18760
|
+
"redact",
|
|
18757
18761
|
"remove",
|
|
18758
18762
|
"restore",
|
|
18759
18763
|
"rewrite"
|
|
18760
18764
|
];
|
|
18761
18765
|
var PRIVILEGED_COMMIT_OPERATIONS = {
|
|
18766
|
+
redact: "things:redact",
|
|
18762
18767
|
remove: "things:delete",
|
|
18763
18768
|
rewrite: "things:rewrite"
|
|
18764
18769
|
};
|
|
@@ -18837,7 +18842,16 @@ var COMPONENT_TEMPLATE_VALUES = {
|
|
|
18837
18842
|
"org-name": (ctx) => ctx.orgName,
|
|
18838
18843
|
"repo-name": (ctx) => ctx.repoName
|
|
18839
18844
|
};
|
|
18840
|
-
|
|
18845
|
+
function parseComponentTemplateToken(raw) {
|
|
18846
|
+
switch (raw) {
|
|
18847
|
+
case "org-name":
|
|
18848
|
+
case "repo-name":
|
|
18849
|
+
return raw;
|
|
18850
|
+
default:
|
|
18851
|
+
return;
|
|
18852
|
+
}
|
|
18853
|
+
}
|
|
18854
|
+
var TEMPLATE_TOKEN_RE = /<([^>]+)>/g;
|
|
18841
18855
|
function listComponentTemplateTokens(value) {
|
|
18842
18856
|
const tokens = new Set;
|
|
18843
18857
|
for (const match of value.matchAll(TEMPLATE_TOKEN_RE)) {
|
|
@@ -18848,15 +18862,15 @@ function listComponentTemplateTokens(value) {
|
|
|
18848
18862
|
return [...tokens];
|
|
18849
18863
|
}
|
|
18850
18864
|
function unsupportedComponentTemplateTokens(value) {
|
|
18851
|
-
return listComponentTemplateTokens(value).filter((token) =>
|
|
18865
|
+
return listComponentTemplateTokens(value).filter((token) => parseComponentTemplateToken(token) === undefined);
|
|
18852
18866
|
}
|
|
18853
18867
|
function resolveComponentTemplate(value, ctx) {
|
|
18854
18868
|
return value.replace(TEMPLATE_TOKEN_RE, (_match, token) => {
|
|
18855
|
-
const
|
|
18856
|
-
if (!
|
|
18869
|
+
const parsed = parseComponentTemplateToken(token);
|
|
18870
|
+
if (!parsed) {
|
|
18857
18871
|
throw new Error(`Unsupported component template token <${token}>`);
|
|
18858
18872
|
}
|
|
18859
|
-
return
|
|
18873
|
+
return COMPONENT_TEMPLATE_VALUES[parsed](ctx);
|
|
18860
18874
|
});
|
|
18861
18875
|
}
|
|
18862
18876
|
|
|
@@ -25940,6 +25954,8 @@ var CORRECTED_THING_SHAPE_NAME = "CorrectedThing";
|
|
|
25940
25954
|
var CORRECTED_THING_FIELDS = {
|
|
25941
25955
|
correctionLog: { type: "array", items: { reason: "string" }, minItems: 1 }
|
|
25942
25956
|
};
|
|
25957
|
+
var REDACTED_THING_SHAPE_NAME = "RedactedThing";
|
|
25958
|
+
var REDACTED_THING_FIELDS = {};
|
|
25943
25959
|
var SYSTEM_SHAPES = [
|
|
25944
25960
|
{
|
|
25945
25961
|
name: "ComponentInstall",
|
|
@@ -25965,6 +25981,12 @@ var SYSTEM_SHAPES = [
|
|
|
25965
25981
|
name: CORRECTED_THING_SHAPE_NAME,
|
|
25966
25982
|
fields: CORRECTED_THING_FIELDS,
|
|
25967
25983
|
onDemand: true
|
|
25984
|
+
},
|
|
25985
|
+
{
|
|
25986
|
+
name: REDACTED_THING_SHAPE_NAME,
|
|
25987
|
+
fields: REDACTED_THING_FIELDS,
|
|
25988
|
+
onDemand: true,
|
|
25989
|
+
systemOnlyCertification: true
|
|
25968
25990
|
}
|
|
25969
25991
|
];
|
|
25970
25992
|
var SYSTEM_MANIFEST = {
|
|
@@ -26006,6 +26028,7 @@ var SYSTEM_PROTECTED_SHAPES = SYSTEM_COMPONENT.shapes.filter((shape) => shape.in
|
|
|
26006
26028
|
var SYSTEM_PROTECTED_FAMILY_SHAPES = SYSTEM_PROTECTED_SHAPES.filter((shape) => shape.onDemand !== true);
|
|
26007
26029
|
var SYSTEM_INFRA_SHAPE_NAMES = new Set(SYSTEM_COMPONENTS.flatMap((entry) => entry.shapes.filter((shape) => shape.installInfra === true).map((shape) => shape.name)));
|
|
26008
26030
|
var SYSTEM_SHAPE_NAMES2 = new Set(SYSTEM_MANIFEST.shapes.map((shape) => shape.name));
|
|
26031
|
+
var SYSTEM_ONLY_CERTIFICATE_SHAPE_NAMES = new Set(SYSTEM_COMPONENT.shapes.filter((shape) => shape.systemOnlyCertification === true).map((shape) => shape.name));
|
|
26009
26032
|
function isSystemShapeName(name) {
|
|
26010
26033
|
return SYSTEM_SHAPE_NAMES2.has(name);
|
|
26011
26034
|
}
|
|
@@ -44826,6 +44849,7 @@ var DEFINITE_CLIENT_REJECT_CODES = new Set([
|
|
|
44826
44849
|
"CONFLICT",
|
|
44827
44850
|
"NAME_TAKEN",
|
|
44828
44851
|
"TARGET_REMOVED",
|
|
44852
|
+
"TARGET_REDACTED",
|
|
44829
44853
|
"ALREADY_RETRACTED",
|
|
44830
44854
|
"ARCHIVED",
|
|
44831
44855
|
"RATE_LIMITED",
|
|
@@ -46325,6 +46349,11 @@ var currentErrorDetailsSchema = exports_external.discriminatedUnion("reason", [
|
|
|
46325
46349
|
reason: exports_external.literal("target_removed"),
|
|
46326
46350
|
targetDurableId: exports_external.string().min(1),
|
|
46327
46351
|
fieldPath: exports_external.string().optional()
|
|
46352
|
+
}).loose(),
|
|
46353
|
+
exports_external.object({
|
|
46354
|
+
reason: exports_external.literal("target_redacted"),
|
|
46355
|
+
targetDurableId: exports_external.string().min(1),
|
|
46356
|
+
fieldPath: exports_external.string().optional()
|
|
46328
46357
|
}).loose()
|
|
46329
46358
|
]);
|
|
46330
46359
|
var currentBaseShape = {
|
|
@@ -46831,7 +46860,7 @@ function createStreamingSubmissionHandle(input, deps) {
|
|
|
46831
46860
|
// ../../packages/sdk-ts/package.json
|
|
46832
46861
|
var package_default = {
|
|
46833
46862
|
name: "@warmhub/sdk-ts",
|
|
46834
|
-
version: "0.
|
|
46863
|
+
version: "0.146.0",
|
|
46835
46864
|
private: false,
|
|
46836
46865
|
type: "module",
|
|
46837
46866
|
description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -49049,6 +49078,19 @@ class WarmHubClient {
|
|
|
49049
49078
|
throw toWarmHubError(error51);
|
|
49050
49079
|
}
|
|
49051
49080
|
},
|
|
49081
|
+
redact: async (orgName, repoName, durableId, opts) => {
|
|
49082
|
+
try {
|
|
49083
|
+
return await this.trpc.thing.redact.mutate({
|
|
49084
|
+
orgName,
|
|
49085
|
+
repoName,
|
|
49086
|
+
durableId,
|
|
49087
|
+
expectedVersion: opts.expectedVersion,
|
|
49088
|
+
eventRequestId: opts.eventRequestId
|
|
49089
|
+
});
|
|
49090
|
+
} catch (error51) {
|
|
49091
|
+
throw toWarmHubError(error51);
|
|
49092
|
+
}
|
|
49093
|
+
},
|
|
49052
49094
|
rewrite: async (orgName, repoName, wref, opts) => {
|
|
49053
49095
|
try {
|
|
49054
49096
|
return await this.trpc.thing.rewrite.mutate({
|
|
@@ -49802,6 +49844,10 @@ function unauthenticatedHint(message) {
|
|
|
49802
49844
|
}
|
|
49803
49845
|
return "Check credentials and backend permissions.";
|
|
49804
49846
|
}
|
|
49847
|
+
function signedOutNotFoundHint(profile) {
|
|
49848
|
+
const flag = profile && profile !== "default" ? ` --profile ${profile}` : "";
|
|
49849
|
+
return `Not logged in, so only public data is visible. If this is private, run \`wh auth login${flag}\`.`;
|
|
49850
|
+
}
|
|
49805
49851
|
function reloginHint(profile) {
|
|
49806
49852
|
const named = profile ? ` for profile "${profile}"` : "";
|
|
49807
49853
|
const flag = profile && profile !== "default" ? ` --profile ${profile}` : "";
|
|
@@ -50288,6 +50334,13 @@ function usageError(usage, ...examples) {
|
|
|
50288
50334
|
`)}`;
|
|
50289
50335
|
throw new CliError(2 /* UserInput */, "USER_INPUT", usage, undefined, hint);
|
|
50290
50336
|
}
|
|
50337
|
+
function withSignedOutHint(error51, profile) {
|
|
50338
|
+
const notFound = error51.errorCode === "NOT_FOUND" || error51.cause instanceof WarmHubError && error51.cause.code === "NOT_FOUND";
|
|
50339
|
+
const login = signedOutNotFoundHint(profile);
|
|
50340
|
+
if (!notFound || error51.hint?.includes(login))
|
|
50341
|
+
return error51;
|
|
50342
|
+
return new CliError(error51.code, error51.kind, error51.message, error51.cause, error51.hint ? `${error51.hint} ${login}` : login, error51.context, error51.errorCode, error51.recovery);
|
|
50343
|
+
}
|
|
50291
50344
|
function toCliError(err, opts) {
|
|
50292
50345
|
if (err instanceof CliError)
|
|
50293
50346
|
return err;
|
|
@@ -51867,11 +51920,13 @@ function loadProfileStore(path) {
|
|
|
51867
51920
|
} catch (cause) {
|
|
51868
51921
|
throw corruptedAuthError(p, cause);
|
|
51869
51922
|
}
|
|
51870
|
-
if (
|
|
51923
|
+
if (!isProfileStore(parsed))
|
|
51871
51924
|
throw corruptedAuthError(p);
|
|
51872
|
-
}
|
|
51873
51925
|
return parsed;
|
|
51874
51926
|
}
|
|
51927
|
+
function isProfileStore(value) {
|
|
51928
|
+
return isPlainObject(value) && value.version === 1 && isPlainObject(value.profiles) && Object.values(value.profiles).every((profile) => isPlainObject(profile) && isPlainObject(profile.tokens));
|
|
51929
|
+
}
|
|
51875
51930
|
function corruptedAuthError(path, cause) {
|
|
51876
51931
|
getLog().error("auth.profile.corrupt", { path });
|
|
51877
51932
|
return new CliError(3 /* Config */, "CONFIG", `Auth file at ${path} is unreadable or in an unknown format.`, cause, `Remove the file (\`rm ${path}\`) and run \`wh auth login\` to re-authenticate.`);
|
|
@@ -51941,6 +51996,14 @@ function getTokenInfo(profile) {
|
|
|
51941
51996
|
canRefresh: source === "device" && !!tokens.refreshToken
|
|
51942
51997
|
};
|
|
51943
51998
|
}
|
|
51999
|
+
function isSignedOut(profile) {
|
|
52000
|
+
try {
|
|
52001
|
+
const info = getTokenInfo(profile);
|
|
52002
|
+
return !info || info.source === "token" && info.expired;
|
|
52003
|
+
} catch {
|
|
52004
|
+
return false;
|
|
52005
|
+
}
|
|
52006
|
+
}
|
|
51944
52007
|
async function getValidToken(profile, signal, options = {}) {
|
|
51945
52008
|
const log = getLog();
|
|
51946
52009
|
const envToken = process.env.WH_TOKEN;
|
|
@@ -53199,21 +53262,17 @@ function writeInstallSnapshotCache(repoSlug, cache) {
|
|
|
53199
53262
|
renameSync3(tmp, path);
|
|
53200
53263
|
}
|
|
53201
53264
|
}
|
|
53202
|
-
function isPlainObject3(value) {
|
|
53203
|
-
return typeof value === "object" && value !== null;
|
|
53204
|
-
}
|
|
53205
53265
|
function isInstallSnapshotCacheShape(value) {
|
|
53206
|
-
if (!
|
|
53266
|
+
if (!isPlainObject(value))
|
|
53207
53267
|
return false;
|
|
53208
53268
|
if (typeof value.cachedAt !== "number")
|
|
53209
53269
|
return false;
|
|
53210
53270
|
if (typeof value.repoSlug !== "string")
|
|
53211
53271
|
return false;
|
|
53212
|
-
if (!
|
|
53272
|
+
if (!isPlainObject(value.components))
|
|
53213
53273
|
return false;
|
|
53214
|
-
const
|
|
53215
|
-
|
|
53216
|
-
if (!isPlainObject3(entry))
|
|
53274
|
+
for (const entry of Object.values(value.components)) {
|
|
53275
|
+
if (!isPlainObject(entry))
|
|
53217
53276
|
return false;
|
|
53218
53277
|
const component = entry;
|
|
53219
53278
|
if (typeof component.ref !== "string")
|
|
@@ -53232,11 +53291,10 @@ function isInstallSnapshotCacheShape(value) {
|
|
|
53232
53291
|
if (!Array.isArray(component.methods))
|
|
53233
53292
|
return false;
|
|
53234
53293
|
}
|
|
53235
|
-
if (!
|
|
53294
|
+
if (!isPlainObject(value.installs))
|
|
53236
53295
|
return false;
|
|
53237
|
-
const
|
|
53238
|
-
|
|
53239
|
-
if (!isPlainObject3(entry))
|
|
53296
|
+
for (const entry of Object.values(value.installs)) {
|
|
53297
|
+
if (!isPlainObject(entry))
|
|
53240
53298
|
return false;
|
|
53241
53299
|
const install = entry;
|
|
53242
53300
|
if (typeof install.ref !== "string")
|
|
@@ -54142,7 +54200,7 @@ function emitNoMatchHint(ctx, match, count) {
|
|
|
54142
54200
|
}
|
|
54143
54201
|
|
|
54144
54202
|
// ../../packages/warmhub-cli/src/domains/commit-output-contract-id.ts
|
|
54145
|
-
var COMMIT_SUBMIT_OUTPUT_SCHEMA_ID = "wh.commit.submit.result/v0.
|
|
54203
|
+
var COMMIT_SUBMIT_OUTPUT_SCHEMA_ID = "wh.commit.submit.result/v0.12";
|
|
54146
54204
|
function identifyCommitSubmitOutput(value) {
|
|
54147
54205
|
if ("schema" in value) {
|
|
54148
54206
|
if (value.schema === COMMIT_SUBMIT_OUTPUT_SCHEMA_ID) {
|
|
@@ -56136,6 +56194,59 @@ function renderQueryResults(out, c, result) {
|
|
|
56136
56194
|
out(`${c.dim}${items.length} result(s)${c.reset}`);
|
|
56137
56195
|
}
|
|
56138
56196
|
|
|
56197
|
+
// ../../packages/warmhub-cli/src/domains/thing/redact.ts
|
|
56198
|
+
var USAGE = "Usage: wh thing redact <durableId> [--expected-version <n>] [--yes]";
|
|
56199
|
+
var EXAMPLE = "wh thing redact 040T1QCTF2Y79... --expected-version 3 --yes";
|
|
56200
|
+
var redactFlags = {
|
|
56201
|
+
"expected-version": flag.number({
|
|
56202
|
+
description: "only redact if the Thing is still at this version (default: the version read before redacting)"
|
|
56203
|
+
}),
|
|
56204
|
+
yes: flag.boolean({ short: "y", description: "Skip confirmation prompt" }),
|
|
56205
|
+
"event-request-id": operationEventRequestIdFlag
|
|
56206
|
+
};
|
|
56207
|
+
var handleThingRedact = async (ctx, { flags, args }) => {
|
|
56208
|
+
const durableId = args[0];
|
|
56209
|
+
if (!durableId)
|
|
56210
|
+
usageError(USAGE, EXAMPLE);
|
|
56211
|
+
const repoRef = getRepoRef(ctx);
|
|
56212
|
+
if (!isDurableId(durableId)) {
|
|
56213
|
+
usageError(`${USAGE}
|
|
56214
|
+
Redaction requires the Thing's bare durable ID, never a wref.`, `wh thing resolve ${durableId}${repoRef ? ` --repo ${repoRef}` : ""}`);
|
|
56215
|
+
}
|
|
56216
|
+
const { org, repo } = parseOrgRepo(repoRef, ctx.config);
|
|
56217
|
+
const c = ctx.colors;
|
|
56218
|
+
let expectedVersion = parsePositiveIntFlag(flags["expected-version"], "--expected-version", EXAMPLE);
|
|
56219
|
+
let label = durableId;
|
|
56220
|
+
if (expectedVersion === undefined || !flags.yes) {
|
|
56221
|
+
const thing = await ctx.client.thing.get(org, repo, durableId, undefined, {
|
|
56222
|
+
includeRetracted: true
|
|
56223
|
+
});
|
|
56224
|
+
expectedVersion ??= thing.version;
|
|
56225
|
+
label = `${thing.wref} (${durableId})`;
|
|
56226
|
+
}
|
|
56227
|
+
if (!flags.yes) {
|
|
56228
|
+
const confirmed = await ctx.confirm?.(`Irreversibly redact ${label} at v${expectedVersion}? This erases its canonical content and former name, but not backups, completed exports, logs, or downstream copies.`);
|
|
56229
|
+
if (!confirmed) {
|
|
56230
|
+
ctx.status("Cancelled");
|
|
56231
|
+
return;
|
|
56232
|
+
}
|
|
56233
|
+
}
|
|
56234
|
+
const eventRequestId = flags["event-request-id"] ?? createOperationEventRequestId();
|
|
56235
|
+
ctx.status(`Operation event request: ${eventRequestId}`);
|
|
56236
|
+
const receipt = await ctx.client.thing.redact(org, repo, durableId, {
|
|
56237
|
+
eventRequestId,
|
|
56238
|
+
expectedVersion
|
|
56239
|
+
});
|
|
56240
|
+
writeOutput(ctx, receipt, () => {
|
|
56241
|
+
if (receipt.pruned) {
|
|
56242
|
+
ctx.out(`${c.dim}Replayed${c.reset} ${displayName(c, durableId)} (the receipt was pruned; the Thing was removed since)`);
|
|
56243
|
+
return;
|
|
56244
|
+
}
|
|
56245
|
+
const operation = receipt.operations.find((candidate) => candidate.operation === "redact");
|
|
56246
|
+
ctx.out(operation?.status === "noop" ? `${c.dim}Already redacted${c.reset} ${displayName(c, durableId)}` : `${c.green}Redacted${c.reset} ${displayName(c, durableId)}`);
|
|
56247
|
+
});
|
|
56248
|
+
};
|
|
56249
|
+
|
|
56139
56250
|
// ../../packages/warmhub-cli/src/domains/thing/refs.ts
|
|
56140
56251
|
var refsFlags = {
|
|
56141
56252
|
inbound: flag.boolean({
|
|
@@ -56254,8 +56365,8 @@ var handleReleaseLease = async (ctx, { flags, args }) => {
|
|
|
56254
56365
|
};
|
|
56255
56366
|
|
|
56256
56367
|
// ../../packages/warmhub-cli/src/domains/thing/remove.ts
|
|
56257
|
-
var
|
|
56258
|
-
var
|
|
56368
|
+
var USAGE2 = "Usage: wh thing remove <wref|durableId> [--expected-version <n>] [--yes]";
|
|
56369
|
+
var EXAMPLE2 = "wh thing remove cave --yes";
|
|
56259
56370
|
var removeFlags = {
|
|
56260
56371
|
"expected-version": flag.number({
|
|
56261
56372
|
description: "only remove if the Thing is still at this version (default: the version read before removing)"
|
|
@@ -56266,7 +56377,7 @@ var removeFlags = {
|
|
|
56266
56377
|
var handleThingRemove = async (ctx, { flags, args }) => {
|
|
56267
56378
|
const target = args[0];
|
|
56268
56379
|
if (!target)
|
|
56269
|
-
usageError(
|
|
56380
|
+
usageError(USAGE2, EXAMPLE2);
|
|
56270
56381
|
const { org, repo } = parseOrgRepo(getRepoRef(ctx), ctx.config);
|
|
56271
56382
|
const c = ctx.colors;
|
|
56272
56383
|
let expectedVersion = parsePositiveIntFlag(flags["expected-version"], "--expected-version", "wh thing remove cave --expected-version 3");
|
|
@@ -56476,8 +56587,8 @@ var handleRevise2 = async (ctx, { flags, args }) => {
|
|
|
56476
56587
|
};
|
|
56477
56588
|
|
|
56478
56589
|
// ../../packages/warmhub-cli/src/domains/thing/rewrite.ts
|
|
56479
|
-
var
|
|
56480
|
-
var
|
|
56590
|
+
var USAGE3 = "Usage: wh thing rewrite <name@vN|durableId@vN> --shape <Shape>... (--data <json-object> | --file <path>) [--yes]";
|
|
56591
|
+
var EXAMPLE3 = "wh thing rewrite cave@v2 --shape Location --shape CorrectedThing --file corrected.json --yes";
|
|
56481
56592
|
var rewriteFlags = {
|
|
56482
56593
|
shape: flag.string({
|
|
56483
56594
|
multiple: true,
|
|
@@ -56497,24 +56608,24 @@ function parseTarget(target) {
|
|
|
56497
56608
|
try {
|
|
56498
56609
|
parsed = parseWref(target);
|
|
56499
56610
|
} catch (error51) {
|
|
56500
|
-
usageError(`${
|
|
56501
|
-
${error51 instanceof Error ? error51.message : String(error51)}`,
|
|
56611
|
+
usageError(`${USAGE3}
|
|
56612
|
+
${error51 instanceof Error ? error51.message : String(error51)}`, EXAMPLE3);
|
|
56502
56613
|
}
|
|
56503
56614
|
if (parsed.version.type !== "pinned") {
|
|
56504
|
-
usageError(`${
|
|
56505
|
-
Name the exact version to correct, e.g. cave@v2.`,
|
|
56615
|
+
usageError(`${USAGE3}
|
|
56616
|
+
Name the exact version to correct, e.g. cave@v2.`, EXAMPLE3);
|
|
56506
56617
|
}
|
|
56507
56618
|
return { wref: stripWrefVersion(target), version: parsed.version.n };
|
|
56508
56619
|
}
|
|
56509
56620
|
var handleThingRewrite = async (ctx, { flags, args }) => {
|
|
56510
56621
|
const target = args[0];
|
|
56511
56622
|
if (!target)
|
|
56512
|
-
usageError(
|
|
56623
|
+
usageError(USAGE3, EXAMPLE3);
|
|
56513
56624
|
const { wref, version: version2 } = parseTarget(target);
|
|
56514
56625
|
const shapes = flags.shape ?? [];
|
|
56515
56626
|
if (shapes.length === 0) {
|
|
56516
|
-
usageError(`${
|
|
56517
|
-
State the Shapes the version declares, plus CorrectedThing.`,
|
|
56627
|
+
usageError(`${USAGE3}
|
|
56628
|
+
State the Shapes the version declares, plus CorrectedThing.`, EXAMPLE3);
|
|
56518
56629
|
}
|
|
56519
56630
|
const { org, repo } = parseOrgRepo(getRepoRef(ctx), ctx.config);
|
|
56520
56631
|
const c = ctx.colors;
|
|
@@ -56523,7 +56634,7 @@ State the Shapes the version declares, plus CorrectedThing.`, EXAMPLE2);
|
|
|
56523
56634
|
file: flags.file,
|
|
56524
56635
|
inlineFlag: "--data",
|
|
56525
56636
|
missingMessage: "--data is required for rewrite unless --file is provided: the complete replacement body",
|
|
56526
|
-
example:
|
|
56637
|
+
example: EXAMPLE3
|
|
56527
56638
|
});
|
|
56528
56639
|
if (ctx.dryRun) {
|
|
56529
56640
|
const validation = await ctx.client.commit.validate(org, repo, [
|
|
@@ -57126,6 +57237,20 @@ var THING_DOMAIN = defineDomain({
|
|
|
57126
57237
|
],
|
|
57127
57238
|
handler: handleThingRemove
|
|
57128
57239
|
},
|
|
57240
|
+
redact: {
|
|
57241
|
+
prime: false,
|
|
57242
|
+
summary: "Irreversibly erase canonical content while preserving identity (needs things:redact)",
|
|
57243
|
+
args: "<durableId>",
|
|
57244
|
+
flags: redactFlags,
|
|
57245
|
+
examples: [
|
|
57246
|
+
"wh thing redact 040T1QCTF2Y79... --yes",
|
|
57247
|
+
"wh thing redact 040T1QCTF2Y79... --expected-version 3 --yes"
|
|
57248
|
+
],
|
|
57249
|
+
notes: [
|
|
57250
|
+
"Core redaction does not erase backups, completed exports, logs, or copies already delivered downstream."
|
|
57251
|
+
],
|
|
57252
|
+
handler: handleThingRedact
|
|
57253
|
+
},
|
|
57129
57254
|
rewrite: {
|
|
57130
57255
|
prime: false,
|
|
57131
57256
|
summary: "Replace the body of one exact version in place (needs things:rewrite)",
|
|
@@ -59687,7 +59812,7 @@ var createFlags3 = {
|
|
|
59687
59812
|
};
|
|
59688
59813
|
|
|
59689
59814
|
// ../../packages/warmhub-cli/src/domains/commit-stream-output-contract-id.ts
|
|
59690
|
-
var COMMIT_SUBMIT_STREAM_ROW_SCHEMA_ID = "wh.commit.submit.stream.row/v0.
|
|
59815
|
+
var COMMIT_SUBMIT_STREAM_ROW_SCHEMA_ID = "wh.commit.submit.stream.row/v0.11";
|
|
59691
59816
|
function identify(row) {
|
|
59692
59817
|
if ("schema" in row) {
|
|
59693
59818
|
throw new Error("Streaming submission row already defines a schema field");
|
|
@@ -59954,6 +60079,7 @@ function retractHint(name) {
|
|
|
59954
60079
|
return `use {"operation":"retract","name":"${name ?? "<wref>"}"} or \`wh commit submit --retract${name ? ` ${name}` : ""}\``;
|
|
59955
60080
|
}
|
|
59956
60081
|
var PRIVILEGED_OPERATION_HINTS = {
|
|
60082
|
+
redact: ({ name }) => `To irreversibly erase canonical Thing content while preserving its identity, use \`wh thing redact ${name && isDurableId(name) ? name : "<durable-id>"} --expected-version <n> --yes\`.`,
|
|
59957
60083
|
remove: ({ name }) => `To delete the Thing permanently, use \`wh thing remove ${name ?? "<wref>"}\`. To withdraw it, ${retractHint(name)}.`,
|
|
59958
60084
|
rewrite: ({ name, version: version2 }) => `To correct a version in place, use \`wh thing rewrite ${name ?? "<wref>"}@v${typeof version2 === "number" ? version2 : "<n>"} --shape <Shape>... --file <body.json>\`.`
|
|
59959
60085
|
};
|
|
@@ -61665,7 +61791,7 @@ function bindComponentMethodArgs(invocation, method) {
|
|
|
61665
61791
|
}
|
|
61666
61792
|
|
|
61667
61793
|
// ../../packages/warmhub-cli/src/component-exec.ts
|
|
61668
|
-
var
|
|
61794
|
+
var USAGE4 = "wh component exec <component> <method> [args] --repo org/repo";
|
|
61669
61795
|
function methodHelpHint(componentName, methodName, installRepo) {
|
|
61670
61796
|
return `wh component exec ${componentName} ${methodName} --help --repo ${installRepo}`;
|
|
61671
61797
|
}
|
|
@@ -61719,7 +61845,7 @@ var handleComponentExec = async (ctx, _domain) => {
|
|
|
61719
61845
|
const helpRequested = invocation.help;
|
|
61720
61846
|
const dryRun = invocation.flags["dry-run"] === true;
|
|
61721
61847
|
if (!invocation.component)
|
|
61722
|
-
usageError("Component name is required",
|
|
61848
|
+
usageError("Component name is required", USAGE4);
|
|
61723
61849
|
const componentName = invocation.component;
|
|
61724
61850
|
const methodName = invocation.method;
|
|
61725
61851
|
const { org, repo } = parseOrgRepo(getRepoRef(ctx), ctx.config);
|
|
@@ -72158,7 +72284,8 @@ async function runPreparedCli(rawArgv, prepared, opts) {
|
|
|
72158
72284
|
exitCode = cancelledExitCode;
|
|
72159
72285
|
return exitCode;
|
|
72160
72286
|
}
|
|
72161
|
-
const
|
|
72287
|
+
const converted = toCliError2(error51, { profile: activeProfile });
|
|
72288
|
+
const cliError = isSignedOut(activeProfile) ? withSignedOutHint(converted, activeProfile) : converted;
|
|
72162
72289
|
const fields = {
|
|
72163
72290
|
kind: cliError.kind,
|
|
72164
72291
|
exit_code: cliError.code,
|
|
@@ -72248,7 +72375,7 @@ function resolveLogLevel(flagLevel, env) {
|
|
|
72248
72375
|
// package.json
|
|
72249
72376
|
var package_default3 = {
|
|
72250
72377
|
name: "@warmhub/cli",
|
|
72251
|
-
version: "0.
|
|
72378
|
+
version: "0.148.0",
|
|
72252
72379
|
private: false,
|
|
72253
72380
|
type: "module",
|
|
72254
72381
|
description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -72331,17 +72458,20 @@ async function maybeHandleComponentShellBoundary(prepared, deps = {}) {
|
|
|
72331
72458
|
const writeErr = deps.err ?? err;
|
|
72332
72459
|
const debug = prepared.presentation.debug === true || process.env.WARMHUB_DEBUG === "1";
|
|
72333
72460
|
const format = prepared.presentation.format;
|
|
72461
|
+
let profile;
|
|
72334
72462
|
try {
|
|
72335
72463
|
if (invocation.flags["dry-run"] === true)
|
|
72336
72464
|
return;
|
|
72337
72465
|
const source = invocation.positionals[0];
|
|
72338
|
-
const
|
|
72466
|
+
const context = resolveCliContext({
|
|
72339
72467
|
invocation,
|
|
72340
72468
|
format,
|
|
72341
72469
|
functionLogs: "off",
|
|
72342
72470
|
config: deps.config,
|
|
72343
72471
|
client: deps.client
|
|
72344
72472
|
});
|
|
72473
|
+
const { config: config2, client } = context;
|
|
72474
|
+
profile = context.profile;
|
|
72345
72475
|
if (!source) {
|
|
72346
72476
|
return;
|
|
72347
72477
|
}
|
|
@@ -72366,7 +72496,9 @@ async function maybeHandleComponentShellBoundary(prepared, deps = {}) {
|
|
|
72366
72496
|
writeErr
|
|
72367
72497
|
});
|
|
72368
72498
|
} catch (error51) {
|
|
72369
|
-
|
|
72499
|
+
const converted = toCliError2(error51, { profile });
|
|
72500
|
+
const cliError = isSignedOut(profile) ? withSignedOutHint(converted, profile) : converted;
|
|
72501
|
+
return printCliError(cliError, writeErr, {
|
|
72370
72502
|
format,
|
|
72371
72503
|
debug
|
|
72372
72504
|
});
|
|
@@ -72873,5 +73005,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
|
|
|
72873
73005
|
version: package_default3.version
|
|
72874
73006
|
}) : interceptedExitCode;
|
|
72875
73007
|
|
|
72876
|
-
//# debugId=
|
|
72877
|
-
//# warmhub-cli-build-info {"cliVersion":"0.
|
|
73008
|
+
//# debugId=1702690161D073CA64756E2164756E21
|
|
73009
|
+
//# warmhub-cli-build-info {"cliVersion":"0.148.0","sdkVersion":"0.146.0"}
|
package/package.json
CHANGED