@autohq/cli 0.1.382 → 0.1.384
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/agent-bridge.js +36 -18
- package/dist/index.js +65 -40
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23492,7 +23492,7 @@ Object.assign(lookup, {
|
|
|
23492
23492
|
// package.json
|
|
23493
23493
|
var package_default = {
|
|
23494
23494
|
name: "@autohq/cli",
|
|
23495
|
-
version: "0.1.
|
|
23495
|
+
version: "0.1.384",
|
|
23496
23496
|
license: "SEE LICENSE IN README.md",
|
|
23497
23497
|
publishConfig: {
|
|
23498
23498
|
access: "public"
|
|
@@ -26299,35 +26299,35 @@ var SecretDescriptionSchema = external_exports.string().trim().max(1024);
|
|
|
26299
26299
|
var SECRET_IDLE_EXPIRY_MAX_SECONDS = 10 * 365 * 24 * 60 * 60;
|
|
26300
26300
|
var SecretExpiresAtSchema = external_exports.string().datetime({ offset: true });
|
|
26301
26301
|
var SecretIdleExpirySecondsSchema = external_exports.number().int().min(1).max(SECRET_IDLE_EXPIRY_MAX_SECONDS);
|
|
26302
|
-
var
|
|
26303
|
-
var
|
|
26304
|
-
var
|
|
26302
|
+
var SECRET_INJECTION_HOST_PATTERN = /^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
26303
|
+
var SECRET_INJECTION_HEADER_PATTERN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
26304
|
+
var SECRET_INJECTION_FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
|
|
26305
26305
|
"connection",
|
|
26306
26306
|
"content-length",
|
|
26307
26307
|
"host",
|
|
26308
26308
|
"transfer-encoding"
|
|
26309
26309
|
]);
|
|
26310
|
-
var
|
|
26311
|
-
|
|
26312
|
-
"
|
|
26310
|
+
var SecretInjectionHostSchema = external_exports.string().trim().toLowerCase().regex(
|
|
26311
|
+
SECRET_INJECTION_HOST_PATTERN,
|
|
26312
|
+
"Injection hosts must be exact lowercase hostnames (no wildcards, schemes, ports, or paths)"
|
|
26313
26313
|
);
|
|
26314
|
-
var
|
|
26315
|
-
(header) => !
|
|
26316
|
-
"This header cannot carry
|
|
26314
|
+
var SecretInjectionHeaderSchema = external_exports.string().trim().min(1).max(128).regex(SECRET_INJECTION_HEADER_PATTERN, "Invalid HTTP header name").refine(
|
|
26315
|
+
(header) => !SECRET_INJECTION_FORBIDDEN_HEADERS.has(header.toLowerCase()),
|
|
26316
|
+
"This header cannot carry an injected secret"
|
|
26317
26317
|
);
|
|
26318
|
-
var
|
|
26319
|
-
hosts: external_exports.array(
|
|
26320
|
-
header:
|
|
26318
|
+
var SecretInjectionSchema = external_exports.object({
|
|
26319
|
+
hosts: external_exports.array(SecretInjectionHostSchema).min(1).max(16),
|
|
26320
|
+
header: SecretInjectionHeaderSchema,
|
|
26321
26321
|
format: external_exports.string().min(1).max(256).refine(
|
|
26322
26322
|
(format) => format.includes("{value}"),
|
|
26323
|
-
"
|
|
26323
|
+
"Injection format must contain the {value} placeholder"
|
|
26324
26324
|
).optional()
|
|
26325
26325
|
});
|
|
26326
26326
|
var SecretSetRequestSchema = external_exports.object({
|
|
26327
26327
|
value: external_exports.string(),
|
|
26328
26328
|
description: SecretDescriptionSchema.nullable().optional(),
|
|
26329
26329
|
protected: external_exports.boolean().optional(),
|
|
26330
|
-
|
|
26330
|
+
injection: SecretInjectionSchema.nullable().optional(),
|
|
26331
26331
|
expiresAt: SecretExpiresAtSchema.nullable().optional(),
|
|
26332
26332
|
idleExpirySeconds: SecretIdleExpirySecondsSchema.nullable().optional()
|
|
26333
26333
|
});
|
|
@@ -26349,13 +26349,14 @@ var SecretMetadataSchema = external_exports.object({
|
|
|
26349
26349
|
description: external_exports.string().nullable(),
|
|
26350
26350
|
protected: external_exports.boolean(),
|
|
26351
26351
|
// Defaulted rather than required so a newer client parsing an older
|
|
26352
|
-
// server's metadata (deploy skew) treats an absent
|
|
26353
|
-
|
|
26352
|
+
// server's metadata (deploy skew) treats an absent injection as plain
|
|
26353
|
+
// env delivery.
|
|
26354
|
+
injection: SecretInjectionSchema.nullable().default(null),
|
|
26354
26355
|
createdAt: external_exports.string().datetime(),
|
|
26355
26356
|
updatedAt: external_exports.string().datetime(),
|
|
26356
26357
|
lastRotatedAt: external_exports.string().datetime().nullable(),
|
|
26357
26358
|
lastAccessedAt: external_exports.string().datetime().nullable(),
|
|
26358
|
-
// Like
|
|
26359
|
+
// Like injection, defaulted for deploy skew: an older server that never sends
|
|
26359
26360
|
// expiry fields parses as a secret that never expires.
|
|
26360
26361
|
expiresAt: external_exports.string().datetime().nullable().default(null),
|
|
26361
26362
|
idleExpirySeconds: external_exports.number().int().nullable().default(null),
|
|
@@ -27951,6 +27952,18 @@ var SessionsArchiveRequestSchema = external_exports.object({
|
|
|
27951
27952
|
session_ids: external_exports.array(SessionIdSchema2).min(1).max(100),
|
|
27952
27953
|
archived: external_exports.boolean()
|
|
27953
27954
|
});
|
|
27955
|
+
var SessionRelationshipLinkSchema = external_exports.object({
|
|
27956
|
+
id: SessionIdSchema2,
|
|
27957
|
+
displayTitle: RunDisplayTitleSchema.nullable().default(null),
|
|
27958
|
+
agentName: external_exports.string().trim().min(1).nullable().default(null)
|
|
27959
|
+
});
|
|
27960
|
+
var SessionRelationshipsSchema = external_exports.object({
|
|
27961
|
+
parent: SessionRelationshipLinkSchema.nullable().default(null),
|
|
27962
|
+
children: external_exports.object({
|
|
27963
|
+
total: external_exports.number().int().nonnegative(),
|
|
27964
|
+
items: external_exports.array(SessionRelationshipLinkSchema)
|
|
27965
|
+
}).default({ total: 0, items: [] })
|
|
27966
|
+
});
|
|
27954
27967
|
var SessionRecordSchema = external_exports.object({
|
|
27955
27968
|
id: SessionIdSchema2,
|
|
27956
27969
|
organizationId: external_exports.string().trim().min(1),
|
|
@@ -27992,6 +28005,7 @@ var SessionRecordSchema = external_exports.object({
|
|
|
27992
28005
|
archivedAt: external_exports.string().datetime().nullable(),
|
|
27993
28006
|
archiveHandoff: external_exports.string().nullable().default(null),
|
|
27994
28007
|
archiveHandoffWrittenAt: external_exports.string().datetime().nullable().default(null),
|
|
28008
|
+
relationships: SessionRelationshipsSchema.optional(),
|
|
27995
28009
|
error: JsonValueSchema2.nullable()
|
|
27996
28010
|
});
|
|
27997
28011
|
var SessionMessageOriginSchema = external_exports.object({
|
|
@@ -28049,6 +28063,7 @@ var SessionListItemSchema = external_exports.object({
|
|
|
28049
28063
|
model: ResolvedAgentModelSelectionSchema.nullable().optional(),
|
|
28050
28064
|
reasoningEffort: external_exports.string().trim().min(1).nullable().optional(),
|
|
28051
28065
|
agent: SessionListItemAgentSchema,
|
|
28066
|
+
relationships: SessionRelationshipsSchema.optional(),
|
|
28052
28067
|
createdAt: external_exports.string().datetime(),
|
|
28053
28068
|
updatedAt: external_exports.string().datetime(),
|
|
28054
28069
|
archivedAt: external_exports.string().datetime().nullable(),
|
|
@@ -28192,6 +28207,9 @@ var OrganizationCreditsResponseSchema = external_exports.object({
|
|
|
28192
28207
|
balanceUsd: UsdAmountSchema,
|
|
28193
28208
|
totalCreditsUsd: UsdAmountSchema,
|
|
28194
28209
|
totalBilledUsageUsd: NonNegativeUsdSchema,
|
|
28210
|
+
// Billed spend over the trailing 24h, so the low-credits banner can compare
|
|
28211
|
+
// the current balance against recent burn without a second request.
|
|
28212
|
+
spendLastDayUsd: NonNegativeUsdSchema,
|
|
28195
28213
|
events: external_exports.array(CreditEventRecordSchema)
|
|
28196
28214
|
});
|
|
28197
28215
|
var AddOrganizationCreditsRequestSchema = external_exports.object({
|
package/dist/index.js
CHANGED
|
@@ -17695,7 +17695,7 @@ var init_mounts = __esm({
|
|
|
17695
17695
|
});
|
|
17696
17696
|
|
|
17697
17697
|
// ../../packages/schemas/src/secrets.ts
|
|
17698
|
-
var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretDescriptionSchema, SECRET_IDLE_EXPIRY_MAX_SECONDS, SecretExpiresAtSchema, SecretIdleExpirySecondsSchema,
|
|
17698
|
+
var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretDescriptionSchema, SECRET_IDLE_EXPIRY_MAX_SECONDS, SecretExpiresAtSchema, SecretIdleExpirySecondsSchema, SECRET_INJECTION_HOST_PATTERN, SECRET_INJECTION_HEADER_PATTERN, SECRET_INJECTION_FORBIDDEN_HEADERS, SecretInjectionHostSchema, SecretInjectionHeaderSchema, SecretInjectionSchema, SecretSetRequestSchema, SecretExpiryUpdateRequestSchema, SecretRotateRequestSchema, SecretMetadataSchema, SecretSetResponseSchema, SecretListResponseSchema, SecretDeleteResponseSchema, SecretExpiryUpdateResponseSchema, SecretRevealResponseSchema;
|
|
17699
17699
|
var init_secrets = __esm({
|
|
17700
17700
|
"../../packages/schemas/src/secrets.ts"() {
|
|
17701
17701
|
"use strict";
|
|
@@ -17731,35 +17731,35 @@ var init_secrets = __esm({
|
|
|
17731
17731
|
SECRET_IDLE_EXPIRY_MAX_SECONDS = 10 * 365 * 24 * 60 * 60;
|
|
17732
17732
|
SecretExpiresAtSchema = external_exports.string().datetime({ offset: true });
|
|
17733
17733
|
SecretIdleExpirySecondsSchema = external_exports.number().int().min(1).max(SECRET_IDLE_EXPIRY_MAX_SECONDS);
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17734
|
+
SECRET_INJECTION_HOST_PATTERN = /^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
17735
|
+
SECRET_INJECTION_HEADER_PATTERN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
17736
|
+
SECRET_INJECTION_FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
|
|
17737
17737
|
"connection",
|
|
17738
17738
|
"content-length",
|
|
17739
17739
|
"host",
|
|
17740
17740
|
"transfer-encoding"
|
|
17741
17741
|
]);
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
"
|
|
17742
|
+
SecretInjectionHostSchema = external_exports.string().trim().toLowerCase().regex(
|
|
17743
|
+
SECRET_INJECTION_HOST_PATTERN,
|
|
17744
|
+
"Injection hosts must be exact lowercase hostnames (no wildcards, schemes, ports, or paths)"
|
|
17745
17745
|
);
|
|
17746
|
-
|
|
17747
|
-
(header) => !
|
|
17748
|
-
"This header cannot carry
|
|
17746
|
+
SecretInjectionHeaderSchema = external_exports.string().trim().min(1).max(128).regex(SECRET_INJECTION_HEADER_PATTERN, "Invalid HTTP header name").refine(
|
|
17747
|
+
(header) => !SECRET_INJECTION_FORBIDDEN_HEADERS.has(header.toLowerCase()),
|
|
17748
|
+
"This header cannot carry an injected secret"
|
|
17749
17749
|
);
|
|
17750
|
-
|
|
17751
|
-
hosts: external_exports.array(
|
|
17752
|
-
header:
|
|
17750
|
+
SecretInjectionSchema = external_exports.object({
|
|
17751
|
+
hosts: external_exports.array(SecretInjectionHostSchema).min(1).max(16),
|
|
17752
|
+
header: SecretInjectionHeaderSchema,
|
|
17753
17753
|
format: external_exports.string().min(1).max(256).refine(
|
|
17754
17754
|
(format) => format.includes("{value}"),
|
|
17755
|
-
"
|
|
17755
|
+
"Injection format must contain the {value} placeholder"
|
|
17756
17756
|
).optional()
|
|
17757
17757
|
});
|
|
17758
17758
|
SecretSetRequestSchema = external_exports.object({
|
|
17759
17759
|
value: external_exports.string(),
|
|
17760
17760
|
description: SecretDescriptionSchema.nullable().optional(),
|
|
17761
17761
|
protected: external_exports.boolean().optional(),
|
|
17762
|
-
|
|
17762
|
+
injection: SecretInjectionSchema.nullable().optional(),
|
|
17763
17763
|
expiresAt: SecretExpiresAtSchema.nullable().optional(),
|
|
17764
17764
|
idleExpirySeconds: SecretIdleExpirySecondsSchema.nullable().optional()
|
|
17765
17765
|
});
|
|
@@ -17781,13 +17781,14 @@ var init_secrets = __esm({
|
|
|
17781
17781
|
description: external_exports.string().nullable(),
|
|
17782
17782
|
protected: external_exports.boolean(),
|
|
17783
17783
|
// Defaulted rather than required so a newer client parsing an older
|
|
17784
|
-
// server's metadata (deploy skew) treats an absent
|
|
17785
|
-
|
|
17784
|
+
// server's metadata (deploy skew) treats an absent injection as plain
|
|
17785
|
+
// env delivery.
|
|
17786
|
+
injection: SecretInjectionSchema.nullable().default(null),
|
|
17786
17787
|
createdAt: external_exports.string().datetime(),
|
|
17787
17788
|
updatedAt: external_exports.string().datetime(),
|
|
17788
17789
|
lastRotatedAt: external_exports.string().datetime().nullable(),
|
|
17789
17790
|
lastAccessedAt: external_exports.string().datetime().nullable(),
|
|
17790
|
-
// Like
|
|
17791
|
+
// Like injection, defaulted for deploy skew: an older server that never sends
|
|
17791
17792
|
// expiry fields parses as a secret that never expires.
|
|
17792
17793
|
expiresAt: external_exports.string().datetime().nullable().default(null),
|
|
17793
17794
|
idleExpirySeconds: external_exports.number().int().nullable().default(null),
|
|
@@ -19471,7 +19472,7 @@ function isSessionTerminalStatus(status) {
|
|
|
19471
19472
|
(terminalStatus) => terminalStatus === status
|
|
19472
19473
|
);
|
|
19473
19474
|
}
|
|
19474
|
-
var SESSION_STATUSES, SESSION_RUNTIME_PHASES, SESSION_TERMINAL_STATUSES, SESSION_DISPLAY_TITLE_MAX_LENGTH, SESSION_ARCHIVE_HANDOFF_MAX_LENGTH, SESSION_MESSAGE_ROLES, SESSION_MESSAGE_STATUSES, SessionStatusSchema, SessionRuntimePhaseSchema, SessionMessageRoleSchema, SessionMessageStatusSchema, RunDisplayTitleSchema, AmbientStatusSchema, SESSION_CHECK_STATUSES, SESSION_CHECK_CONCLUSIONS, SESSION_CHECK_TIMEOUT_PHASES, SessionCheckStatusSchema, SessionCheckConclusionSchema, SessionCheckTimeoutPhaseSchema, ManualSessionRequestSchema, SessionArchiveRequestSchema, SessionArchiveHandoffSchema, SessionsArchiveRequestSchema, SessionRecordSchema, SessionMessageOriginSchema, SessionUiMessageRecordSchema, SessionListItemAgentSchema, SessionListItemSchema, SessionListResponseSchema, SessionsArchiveResponseSchema;
|
|
19475
|
+
var SESSION_STATUSES, SESSION_RUNTIME_PHASES, SESSION_TERMINAL_STATUSES, SESSION_DISPLAY_TITLE_MAX_LENGTH, SESSION_ARCHIVE_HANDOFF_MAX_LENGTH, SESSION_MESSAGE_ROLES, SESSION_MESSAGE_STATUSES, SessionStatusSchema, SessionRuntimePhaseSchema, SessionMessageRoleSchema, SessionMessageStatusSchema, RunDisplayTitleSchema, AmbientStatusSchema, SESSION_CHECK_STATUSES, SESSION_CHECK_CONCLUSIONS, SESSION_CHECK_TIMEOUT_PHASES, SessionCheckStatusSchema, SessionCheckConclusionSchema, SessionCheckTimeoutPhaseSchema, ManualSessionRequestSchema, SessionArchiveRequestSchema, SessionArchiveHandoffSchema, SessionsArchiveRequestSchema, SessionRelationshipLinkSchema, SessionRelationshipsSchema, SessionRecordSchema, SessionMessageOriginSchema, SessionUiMessageRecordSchema, SessionListItemAgentSchema, SessionListItemSchema, SessionListResponseSchema, SessionsArchiveResponseSchema;
|
|
19475
19476
|
var init_sessions = __esm({
|
|
19476
19477
|
"../../packages/schemas/src/sessions.ts"() {
|
|
19477
19478
|
"use strict";
|
|
@@ -19551,6 +19552,18 @@ var init_sessions = __esm({
|
|
|
19551
19552
|
session_ids: external_exports.array(SessionIdSchema).min(1).max(100),
|
|
19552
19553
|
archived: external_exports.boolean()
|
|
19553
19554
|
});
|
|
19555
|
+
SessionRelationshipLinkSchema = external_exports.object({
|
|
19556
|
+
id: SessionIdSchema,
|
|
19557
|
+
displayTitle: RunDisplayTitleSchema.nullable().default(null),
|
|
19558
|
+
agentName: external_exports.string().trim().min(1).nullable().default(null)
|
|
19559
|
+
});
|
|
19560
|
+
SessionRelationshipsSchema = external_exports.object({
|
|
19561
|
+
parent: SessionRelationshipLinkSchema.nullable().default(null),
|
|
19562
|
+
children: external_exports.object({
|
|
19563
|
+
total: external_exports.number().int().nonnegative(),
|
|
19564
|
+
items: external_exports.array(SessionRelationshipLinkSchema)
|
|
19565
|
+
}).default({ total: 0, items: [] })
|
|
19566
|
+
});
|
|
19554
19567
|
SessionRecordSchema = external_exports.object({
|
|
19555
19568
|
id: SessionIdSchema,
|
|
19556
19569
|
organizationId: external_exports.string().trim().min(1),
|
|
@@ -19592,6 +19605,7 @@ var init_sessions = __esm({
|
|
|
19592
19605
|
archivedAt: external_exports.string().datetime().nullable(),
|
|
19593
19606
|
archiveHandoff: external_exports.string().nullable().default(null),
|
|
19594
19607
|
archiveHandoffWrittenAt: external_exports.string().datetime().nullable().default(null),
|
|
19608
|
+
relationships: SessionRelationshipsSchema.optional(),
|
|
19595
19609
|
error: JsonValueSchema.nullable()
|
|
19596
19610
|
});
|
|
19597
19611
|
SessionMessageOriginSchema = external_exports.object({
|
|
@@ -19649,6 +19663,7 @@ var init_sessions = __esm({
|
|
|
19649
19663
|
model: ResolvedAgentModelSelectionSchema.nullable().optional(),
|
|
19650
19664
|
reasoningEffort: external_exports.string().trim().min(1).nullable().optional(),
|
|
19651
19665
|
agent: SessionListItemAgentSchema,
|
|
19666
|
+
relationships: SessionRelationshipsSchema.optional(),
|
|
19652
19667
|
createdAt: external_exports.string().datetime(),
|
|
19653
19668
|
updatedAt: external_exports.string().datetime(),
|
|
19654
19669
|
archivedAt: external_exports.string().datetime().nullable(),
|
|
@@ -19823,6 +19838,9 @@ var init_billing = __esm({
|
|
|
19823
19838
|
balanceUsd: UsdAmountSchema,
|
|
19824
19839
|
totalCreditsUsd: UsdAmountSchema,
|
|
19825
19840
|
totalBilledUsageUsd: NonNegativeUsdSchema,
|
|
19841
|
+
// Billed spend over the trailing 24h, so the low-credits banner can compare
|
|
19842
|
+
// the current balance against recent burn without a second request.
|
|
19843
|
+
spendLastDayUsd: NonNegativeUsdSchema,
|
|
19826
19844
|
events: external_exports.array(CreditEventRecordSchema)
|
|
19827
19845
|
});
|
|
19828
19846
|
AddOrganizationCreditsRequestSchema = external_exports.object({
|
|
@@ -33907,7 +33925,7 @@ var init_package = __esm({
|
|
|
33907
33925
|
"package.json"() {
|
|
33908
33926
|
package_default = {
|
|
33909
33927
|
name: "@autohq/cli",
|
|
33910
|
-
version: "0.1.
|
|
33928
|
+
version: "0.1.384",
|
|
33911
33929
|
license: "SEE LICENSE IN README.md",
|
|
33912
33930
|
publishConfig: {
|
|
33913
33931
|
access: "public"
|
|
@@ -52439,7 +52457,7 @@ async function setSecret(input) {
|
|
|
52439
52457
|
...input.commandOptions.description === void 0 ? {} : { description: input.commandOptions.description },
|
|
52440
52458
|
...resolveProtectedFlag(input.commandOptions),
|
|
52441
52459
|
...resolveExpiryFields(input.commandOptions),
|
|
52442
|
-
...
|
|
52460
|
+
...resolveInjectionFlags(input.commandOptions)
|
|
52443
52461
|
},
|
|
52444
52462
|
{
|
|
52445
52463
|
projectId: await secretProjectId(input),
|
|
@@ -52503,6 +52521,11 @@ async function listSecrets(input) {
|
|
|
52503
52521
|
flags,
|
|
52504
52522
|
`updated ${secret.updatedAt}`
|
|
52505
52523
|
];
|
|
52524
|
+
if (secret.injection) {
|
|
52525
|
+
parts.push(
|
|
52526
|
+
`injected ${secret.injection.header}@${secret.injection.hosts.join(",")}`
|
|
52527
|
+
);
|
|
52528
|
+
}
|
|
52506
52529
|
if (secret.expired) {
|
|
52507
52530
|
parts.push("expired");
|
|
52508
52531
|
} else {
|
|
@@ -52565,27 +52588,29 @@ function resolveExpiryFields(options) {
|
|
|
52565
52588
|
...options.idleExpiry === void 0 ? {} : { idleExpirySeconds: parseIdleExpiry(options.idleExpiry) }
|
|
52566
52589
|
};
|
|
52567
52590
|
}
|
|
52568
|
-
function
|
|
52569
|
-
const
|
|
52570
|
-
if (options.
|
|
52571
|
-
if (
|
|
52572
|
-
throw new Error(
|
|
52591
|
+
function resolveInjectionFlags(options) {
|
|
52592
|
+
const hasInjectionFlags = (options.injectHost?.length ?? 0) > 0 || options.injectHeader !== void 0 || options.injectFormat !== void 0;
|
|
52593
|
+
if (options.clearInjection) {
|
|
52594
|
+
if (hasInjectionFlags) {
|
|
52595
|
+
throw new Error(
|
|
52596
|
+
"Use either --clear-injection or the --inject-* flags, not both."
|
|
52597
|
+
);
|
|
52573
52598
|
}
|
|
52574
|
-
return {
|
|
52599
|
+
return { injection: null };
|
|
52575
52600
|
}
|
|
52576
|
-
if (!
|
|
52601
|
+
if (!hasInjectionFlags) {
|
|
52577
52602
|
return {};
|
|
52578
52603
|
}
|
|
52579
|
-
if (!options.
|
|
52604
|
+
if (!options.injectHost?.length || options.injectHeader === void 0) {
|
|
52580
52605
|
throw new Error(
|
|
52581
|
-
"
|
|
52606
|
+
"An injected secret requires at least one --inject-host and an --inject-header."
|
|
52582
52607
|
);
|
|
52583
52608
|
}
|
|
52584
52609
|
return {
|
|
52585
|
-
|
|
52586
|
-
hosts: options.
|
|
52587
|
-
header: options.
|
|
52588
|
-
...options.
|
|
52610
|
+
injection: {
|
|
52611
|
+
hosts: options.injectHost,
|
|
52612
|
+
header: options.injectHeader,
|
|
52613
|
+
...options.injectFormat === void 0 ? {} : { format: options.injectFormat }
|
|
52589
52614
|
}
|
|
52590
52615
|
};
|
|
52591
52616
|
}
|
|
@@ -52754,17 +52779,17 @@ function registerSecretCommands(program, context) {
|
|
|
52754
52779
|
"--from-env <name>",
|
|
52755
52780
|
"read the secret value from an environment variable"
|
|
52756
52781
|
).option("--description <text>", "human-readable description for the secret").option(
|
|
52757
|
-
"--
|
|
52758
|
-
"
|
|
52782
|
+
"--inject-host <host>",
|
|
52783
|
+
"mark the secret injected for an exact destination host (repeatable); injected secrets are added at the sandbox edge instead of entering the sandbox",
|
|
52759
52784
|
(host, hosts) => [...hosts, host],
|
|
52760
52785
|
[]
|
|
52761
52786
|
).option(
|
|
52762
|
-
"--
|
|
52763
|
-
"HTTP header the
|
|
52787
|
+
"--inject-header <header>",
|
|
52788
|
+
"HTTP header the secret is injected into (e.g. Authorization)"
|
|
52764
52789
|
).option(
|
|
52765
|
-
"--
|
|
52790
|
+
"--inject-format <format>",
|
|
52766
52791
|
'header value template around the secret, e.g. "Bearer {value}"'
|
|
52767
|
-
).option("--
|
|
52792
|
+
).option("--clear-injection", "stop injecting the secret at any destination").option("--protected", "mark write-only: refuse plaintext reveal (default)").option(
|
|
52768
52793
|
"--unprotected",
|
|
52769
52794
|
"allow scope-gated plaintext reveal of this secret"
|
|
52770
52795
|
).option("--raw", "allow empty values and preserve stdin exactly").option(
|