@zixt/host 0.0.102 → 0.0.104
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 +592 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { homedir as homedir3 } from "node:os";
|
|
|
28
28
|
// package.json
|
|
29
29
|
var package_default = {
|
|
30
30
|
name: "@zixt/host",
|
|
31
|
-
version: "0.0.
|
|
31
|
+
version: "0.0.104",
|
|
32
32
|
type: "module",
|
|
33
33
|
exports: {
|
|
34
34
|
".": "./src/client.ts",
|
|
@@ -14672,6 +14672,8 @@ var ID_PREFIXES = {
|
|
|
14672
14672
|
managerApiAction: "maa",
|
|
14673
14673
|
/** One Manager-prepared Webhook Automation setup card (MG-21). */
|
|
14674
14674
|
managerWebhookAction: "mwa",
|
|
14675
|
+
/** One Manager-authored questionnaire waiting in a Conversation. */
|
|
14676
|
+
managerQuestionnaire: "mqu",
|
|
14675
14677
|
/** One Manager inference call's token-metering row (MG-8). */
|
|
14676
14678
|
managerUsage: "mgu",
|
|
14677
14679
|
/** One ordered Manager reply awaiting Slack delivery. */
|
|
@@ -14739,6 +14741,10 @@ var ManagerWebhookActionId = idSchema(
|
|
|
14739
14741
|
ID_PREFIXES.managerWebhookAction,
|
|
14740
14742
|
"Manager webhook action id"
|
|
14741
14743
|
);
|
|
14744
|
+
var ManagerQuestionnaireId = idSchema(
|
|
14745
|
+
ID_PREFIXES.managerQuestionnaire,
|
|
14746
|
+
"Manager questionnaire id"
|
|
14747
|
+
);
|
|
14742
14748
|
var ManagerEmailInboxId = idSchema(
|
|
14743
14749
|
ID_PREFIXES.managerEmailInbox,
|
|
14744
14750
|
"Manager email inbox id"
|
|
@@ -14982,7 +14988,9 @@ var MemberApprovalRequestContext = ApprovalRequestContext.extend({
|
|
|
14982
14988
|
});
|
|
14983
14989
|
var QuestionChoice = external_exports.object({
|
|
14984
14990
|
label: external_exports.string().trim().min(1).max(120),
|
|
14985
|
-
description: external_exports.string().trim().min(1).max(500).optional()
|
|
14991
|
+
description: external_exports.string().trim().min(1).max(500).optional(),
|
|
14992
|
+
/** At most one choice per question may carry this visual recommendation. */
|
|
14993
|
+
recommended: external_exports.boolean().optional()
|
|
14986
14994
|
}).strict();
|
|
14987
14995
|
var QuestionChoices = external_exports.array(QuestionChoice).min(2).max(5).superRefine((choices, ctx) => {
|
|
14988
14996
|
const labels = choices.map(({ label }) => label.toLocaleLowerCase());
|
|
@@ -14990,6 +14998,38 @@ var QuestionChoices = external_exports.array(QuestionChoice).min(2).max(5).super
|
|
|
14990
14998
|
ctx.addIssue({ code: "custom", message: "question choice labels must be unique" });
|
|
14991
14999
|
}
|
|
14992
15000
|
});
|
|
15001
|
+
var QuestionnaireQuestion = external_exports.object({
|
|
15002
|
+
/** Stable model-authored key used only to pair an answer with this snapshot. */
|
|
15003
|
+
id: external_exports.string().trim().min(1).max(80),
|
|
15004
|
+
question: external_exports.string().trim().min(1).max(500),
|
|
15005
|
+
context: external_exports.string().trim().min(1).max(2e3).optional(),
|
|
15006
|
+
/** False is A/B/C/D radio behavior; true permits several choices plus Other. */
|
|
15007
|
+
allowMultiple: external_exports.boolean(),
|
|
15008
|
+
choices: QuestionChoices
|
|
15009
|
+
}).strict().superRefine((question, ctx) => {
|
|
15010
|
+
if (question.choices.filter((choice) => choice.recommended === true).length > 1) {
|
|
15011
|
+
ctx.addIssue({
|
|
15012
|
+
code: "custom",
|
|
15013
|
+
path: ["choices"],
|
|
15014
|
+
message: "a questionnaire question may have at most one recommended choice"
|
|
15015
|
+
});
|
|
15016
|
+
}
|
|
15017
|
+
});
|
|
15018
|
+
var Questionnaire = external_exports.object({
|
|
15019
|
+
title: external_exports.string().trim().min(1).max(160).optional(),
|
|
15020
|
+
questions: external_exports.array(QuestionnaireQuestion).min(1).max(4)
|
|
15021
|
+
}).strict().superRefine((questionnaire, ctx) => {
|
|
15022
|
+
const ids = questionnaire.questions.map(({ id }) => id.toLocaleLowerCase());
|
|
15023
|
+
if (new Set(ids).size !== ids.length) {
|
|
15024
|
+
ctx.addIssue({ code: "custom", path: ["questions"], message: "question ids must be unique" });
|
|
15025
|
+
}
|
|
15026
|
+
});
|
|
15027
|
+
var QuestionnaireAnswer = external_exports.object({
|
|
15028
|
+
questionId: external_exports.string().trim().min(1).max(80),
|
|
15029
|
+
selectedChoices: external_exports.array(external_exports.string().trim().min(1).max(120)).max(5),
|
|
15030
|
+
other: external_exports.string().trim().min(1).max(1e4).optional()
|
|
15031
|
+
}).strict();
|
|
15032
|
+
var QuestionnaireAnswers = external_exports.array(QuestionnaireAnswer).min(1).max(4);
|
|
14993
15033
|
var Approval = external_exports.object({
|
|
14994
15034
|
id: ApprovalId,
|
|
14995
15035
|
orgId: OrgId,
|
|
@@ -15002,6 +15042,10 @@ var Approval = external_exports.object({
|
|
|
15002
15042
|
payload: external_exports.string().max(5e4),
|
|
15003
15043
|
/** Present only when ask_user supplied a bounded multiple-choice question. */
|
|
15004
15044
|
questionChoices: QuestionChoices.optional(),
|
|
15045
|
+
/** Present when ask_user supplied one submit-once multi-question questionnaire. */
|
|
15046
|
+
questionnaire: Questionnaire.optional(),
|
|
15047
|
+
/** Exact submitted questionnaire response, once answered. */
|
|
15048
|
+
questionnaireAnswers: QuestionnaireAnswers.optional(),
|
|
15005
15049
|
status: ApprovalStatus,
|
|
15006
15050
|
deliveryStatus: ApprovalDeliveryStatus,
|
|
15007
15051
|
/** Why delivery became impossible; null while pending or after delivery. */
|
|
@@ -15038,7 +15082,8 @@ var ApprovalProjection = external_exports.discriminatedUnion("metadataRedacted",
|
|
|
15038
15082
|
var ListApprovalsResponse = external_exports.object({ approvals: external_exports.array(ApprovalProjection) });
|
|
15039
15083
|
var DecideApprovalRequest = external_exports.object({
|
|
15040
15084
|
decision: external_exports.enum(["approve", "deny"]),
|
|
15041
|
-
guidance: external_exports.string().max(1e4).optional()
|
|
15085
|
+
guidance: external_exports.string().max(1e4).optional(),
|
|
15086
|
+
questionnaireAnswers: QuestionnaireAnswers.optional()
|
|
15042
15087
|
});
|
|
15043
15088
|
var UpdateGuardrailsRequest = external_exports.object({ policy: GuardrailPolicy });
|
|
15044
15089
|
|
|
@@ -15547,7 +15592,8 @@ var uniqueGithubOperations = external_exports.array(GithubOperation).max(100).su
|
|
|
15547
15592
|
var ApiToolPackOperation = external_exports.enum([
|
|
15548
15593
|
"operation.search",
|
|
15549
15594
|
"operation.inspect",
|
|
15550
|
-
"operation.call"
|
|
15595
|
+
"operation.call",
|
|
15596
|
+
"configuration.read"
|
|
15551
15597
|
]);
|
|
15552
15598
|
var uniqueApiOperations = external_exports.array(ApiToolPackOperation).max(10).superRefine((operations, ctx) => {
|
|
15553
15599
|
if (new Set(operations).size !== operations.length) {
|
|
@@ -15784,6 +15830,124 @@ var IntegrationCategory = external_exports.enum([
|
|
|
15784
15830
|
var ApiHttpMethod = external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]);
|
|
15785
15831
|
var ApiOperationRisk = external_exports.enum(["read", "write", "destructive"]);
|
|
15786
15832
|
var JsonSchemaFragment = external_exports.record(external_exports.string(), external_exports.unknown());
|
|
15833
|
+
var CONFIGURATION_FILE_MAX_BYTES = 1024 * 1024;
|
|
15834
|
+
var CONFIGURATION_FORM_MAX_FIELDS = 60;
|
|
15835
|
+
var ConfigurationFieldId = external_exports.string().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/, "Use lowercase letters, numbers, and underscores.");
|
|
15836
|
+
var ConfigurationFieldBase = {
|
|
15837
|
+
id: ConfigurationFieldId,
|
|
15838
|
+
label: external_exports.string().trim().min(1).max(120),
|
|
15839
|
+
required: external_exports.boolean().default(false),
|
|
15840
|
+
placeholder: external_exports.string().max(300).optional(),
|
|
15841
|
+
hint: external_exports.string().max(1e3).optional(),
|
|
15842
|
+
tooltip: external_exports.string().max(2e3).optional()
|
|
15843
|
+
};
|
|
15844
|
+
var ConfigurationField = external_exports.discriminatedUnion("type", [
|
|
15845
|
+
external_exports.object({ ...ConfigurationFieldBase, type: external_exports.literal("text") }).strict(),
|
|
15846
|
+
external_exports.object({ ...ConfigurationFieldBase, type: external_exports.literal("textarea") }).strict(),
|
|
15847
|
+
external_exports.object({ ...ConfigurationFieldBase, type: external_exports.literal("url") }).strict(),
|
|
15848
|
+
external_exports.object({ ...ConfigurationFieldBase, type: external_exports.literal("email") }).strict(),
|
|
15849
|
+
external_exports.object({ ...ConfigurationFieldBase, type: external_exports.literal("secret") }).strict(),
|
|
15850
|
+
external_exports.object({
|
|
15851
|
+
...ConfigurationFieldBase,
|
|
15852
|
+
type: external_exports.literal("number"),
|
|
15853
|
+
minimum: external_exports.number().finite().optional(),
|
|
15854
|
+
maximum: external_exports.number().finite().optional(),
|
|
15855
|
+
step: external_exports.number().positive().finite().optional()
|
|
15856
|
+
}).strict(),
|
|
15857
|
+
external_exports.object({ ...ConfigurationFieldBase, type: external_exports.literal("checkbox") }).strict(),
|
|
15858
|
+
external_exports.object({
|
|
15859
|
+
...ConfigurationFieldBase,
|
|
15860
|
+
type: external_exports.literal("select"),
|
|
15861
|
+
options: external_exports.array(
|
|
15862
|
+
external_exports.object({
|
|
15863
|
+
value: external_exports.string().min(1).max(200),
|
|
15864
|
+
label: external_exports.string().trim().min(1).max(200)
|
|
15865
|
+
}).strict()
|
|
15866
|
+
).min(1).max(100)
|
|
15867
|
+
}).strict(),
|
|
15868
|
+
external_exports.object({
|
|
15869
|
+
...ConfigurationFieldBase,
|
|
15870
|
+
type: external_exports.literal("file"),
|
|
15871
|
+
acceptedMediaTypes: external_exports.array(external_exports.string().min(1).max(200)).max(30).default([]),
|
|
15872
|
+
maxBytes: external_exports.number().int().min(1).max(CONFIGURATION_FILE_MAX_BYTES).default(CONFIGURATION_FILE_MAX_BYTES)
|
|
15873
|
+
}).strict()
|
|
15874
|
+
]);
|
|
15875
|
+
var ConfigurationSection = external_exports.object({
|
|
15876
|
+
id: ConfigurationFieldId,
|
|
15877
|
+
title: external_exports.string().trim().min(1).max(160),
|
|
15878
|
+
description: external_exports.string().max(2e3).optional(),
|
|
15879
|
+
showWhen: external_exports.object({ fieldId: ConfigurationFieldId, equals: external_exports.boolean() }).strict().optional(),
|
|
15880
|
+
fields: external_exports.array(ConfigurationField).min(1).max(CONFIGURATION_FORM_MAX_FIELDS)
|
|
15881
|
+
}).strict();
|
|
15882
|
+
var ConfigurationForm = external_exports.object({ sections: external_exports.array(ConfigurationSection).min(1).max(30) }).strict().superRefine((form, context) => {
|
|
15883
|
+
const sectionIds = form.sections.map(({ id }) => id);
|
|
15884
|
+
if (new Set(sectionIds).size !== sectionIds.length) {
|
|
15885
|
+
context.addIssue({
|
|
15886
|
+
code: "custom",
|
|
15887
|
+
path: ["sections"],
|
|
15888
|
+
message: "Section identifiers must be unique."
|
|
15889
|
+
});
|
|
15890
|
+
}
|
|
15891
|
+
const fields = form.sections.flatMap(({ fields: fields2 }) => fields2);
|
|
15892
|
+
if (fields.length > CONFIGURATION_FORM_MAX_FIELDS) {
|
|
15893
|
+
context.addIssue({
|
|
15894
|
+
code: "custom",
|
|
15895
|
+
path: ["sections"],
|
|
15896
|
+
message: `A connection form supports up to ${CONFIGURATION_FORM_MAX_FIELDS} fields.`
|
|
15897
|
+
});
|
|
15898
|
+
}
|
|
15899
|
+
const fieldIds = fields.map(({ id }) => id);
|
|
15900
|
+
if (new Set(fieldIds).size !== fieldIds.length) {
|
|
15901
|
+
context.addIssue({
|
|
15902
|
+
code: "custom",
|
|
15903
|
+
path: ["sections"],
|
|
15904
|
+
message: "Field identifiers must be unique across the form."
|
|
15905
|
+
});
|
|
15906
|
+
}
|
|
15907
|
+
const fieldsById = new Map(fields.map((field) => [field.id, field]));
|
|
15908
|
+
for (const [fieldIndex, field] of fields.entries()) {
|
|
15909
|
+
if (field.type === "number" && field.minimum !== void 0 && field.maximum !== void 0 && field.minimum > field.maximum) {
|
|
15910
|
+
context.addIssue({
|
|
15911
|
+
code: "custom",
|
|
15912
|
+
path: ["fields", fieldIndex, "maximum"],
|
|
15913
|
+
message: "Maximum must be greater than or equal to minimum."
|
|
15914
|
+
});
|
|
15915
|
+
}
|
|
15916
|
+
if (field.type === "select" && new Set(field.options.map(({ value }) => value)).size !== field.options.length) {
|
|
15917
|
+
context.addIssue({
|
|
15918
|
+
code: "custom",
|
|
15919
|
+
path: ["fields", fieldIndex, "options"],
|
|
15920
|
+
message: "Option values must be unique."
|
|
15921
|
+
});
|
|
15922
|
+
}
|
|
15923
|
+
}
|
|
15924
|
+
for (const [sectionIndex, section] of form.sections.entries()) {
|
|
15925
|
+
const condition = section.showWhen;
|
|
15926
|
+
if (!condition) continue;
|
|
15927
|
+
const controlling = fieldsById.get(condition.fieldId);
|
|
15928
|
+
if (!controlling || controlling.type !== "checkbox") {
|
|
15929
|
+
context.addIssue({
|
|
15930
|
+
code: "custom",
|
|
15931
|
+
path: ["sections", sectionIndex, "showWhen", "fieldId"],
|
|
15932
|
+
message: "Conditional sections must depend on a checkbox field."
|
|
15933
|
+
});
|
|
15934
|
+
}
|
|
15935
|
+
const controllingSection = form.sections.findIndex(
|
|
15936
|
+
({ fields: candidates }) => candidates.some(({ id }) => id === condition.fieldId)
|
|
15937
|
+
);
|
|
15938
|
+
if (controllingSection >= sectionIndex) {
|
|
15939
|
+
context.addIssue({
|
|
15940
|
+
code: "custom",
|
|
15941
|
+
path: ["sections", sectionIndex, "showWhen", "fieldId"],
|
|
15942
|
+
message: "A conditional section must depend on a checkbox in an earlier section."
|
|
15943
|
+
});
|
|
15944
|
+
}
|
|
15945
|
+
}
|
|
15946
|
+
});
|
|
15947
|
+
var ConfigurationDefinition = external_exports.object({
|
|
15948
|
+
form: ConfigurationForm,
|
|
15949
|
+
agentInstructions: external_exports.string().trim().min(1).max(12e3)
|
|
15950
|
+
}).strict();
|
|
15787
15951
|
var ApiParameter = external_exports.object({
|
|
15788
15952
|
name: external_exports.string().min(1).max(200),
|
|
15789
15953
|
in: external_exports.enum(["path", "query", "header"]),
|
|
@@ -15914,7 +16078,7 @@ var NormalizedApiDefinition = external_exports.object({
|
|
|
15914
16078
|
servers: external_exports.array(ApiServer).min(1).max(30),
|
|
15915
16079
|
defaultServerId: external_exports.string().min(1).max(100),
|
|
15916
16080
|
authSchemes: external_exports.array(ApiAuthScheme).max(20),
|
|
15917
|
-
operations: external_exports.array(ApiOperation)
|
|
16081
|
+
operations: external_exports.array(ApiOperation)
|
|
15918
16082
|
}).strict().superRefine((definition3, context) => {
|
|
15919
16083
|
const unique = (items, path) => {
|
|
15920
16084
|
if (new Set(items).size !== items.length) {
|
|
@@ -15952,13 +16116,14 @@ var IntegrationDefinitionSummary = external_exports.object({
|
|
|
15952
16116
|
logoUrl: external_exports.url().max(2e3).nullable(),
|
|
15953
16117
|
logoAssetId: IntegrationLogoId.nullable(),
|
|
15954
16118
|
accent: external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/),
|
|
15955
|
-
engine: external_exports.
|
|
16119
|
+
engine: external_exports.enum(["api", "configuration"]),
|
|
15956
16120
|
visibility: external_exports.enum(["global", "organization"]),
|
|
15957
16121
|
ownerOrgId: OrgId.nullable(),
|
|
15958
16122
|
isBaseTemplate: external_exports.boolean(),
|
|
15959
16123
|
isBuiltIn: external_exports.boolean(),
|
|
15960
16124
|
revision: external_exports.number().int().min(1),
|
|
15961
16125
|
operationCount: external_exports.number().int().min(0),
|
|
16126
|
+
fieldCount: external_exports.number().int().min(0),
|
|
15962
16127
|
authKinds: external_exports.array(external_exports.enum(["none", "apiKey", "bearer", "basic", "oauth2"])).max(5),
|
|
15963
16128
|
updatedAt: IsoDate
|
|
15964
16129
|
}).strict();
|
|
@@ -15968,6 +16133,7 @@ var IntegrationDefinition = IntegrationDefinitionSummary.extend({
|
|
|
15968
16133
|
allowCustomBaseUrl: external_exports.boolean(),
|
|
15969
16134
|
requiresCustomBaseUrl: external_exports.boolean(),
|
|
15970
16135
|
api: NormalizedApiDefinition,
|
|
16136
|
+
configuration: ConfigurationDefinition.nullable(),
|
|
15971
16137
|
publishedAt: IsoDate
|
|
15972
16138
|
}).strict().superRefine((definition3, context) => {
|
|
15973
16139
|
if (definition3.requiresCustomBaseUrl && !definition3.allowCustomBaseUrl) {
|
|
@@ -15977,6 +16143,20 @@ var IntegrationDefinition = IntegrationDefinitionSummary.extend({
|
|
|
15977
16143
|
message: "A required organization server URL must also be allowed."
|
|
15978
16144
|
});
|
|
15979
16145
|
}
|
|
16146
|
+
if (definition3.engine === "api" && definition3.configuration !== null) {
|
|
16147
|
+
context.addIssue({
|
|
16148
|
+
code: "custom",
|
|
16149
|
+
path: ["configuration"],
|
|
16150
|
+
message: "API Integrations cannot include a configuration form."
|
|
16151
|
+
});
|
|
16152
|
+
}
|
|
16153
|
+
if (definition3.engine === "configuration" && definition3.configuration === null) {
|
|
16154
|
+
context.addIssue({
|
|
16155
|
+
code: "custom",
|
|
16156
|
+
path: ["configuration"],
|
|
16157
|
+
message: "Configuration Integrations require a connection form."
|
|
16158
|
+
});
|
|
16159
|
+
}
|
|
15980
16160
|
});
|
|
15981
16161
|
var IntegrationCatalogQuery = external_exports.object({
|
|
15982
16162
|
q: external_exports.string().max(200).optional(),
|
|
@@ -16056,6 +16236,31 @@ var UploadIntegrationLogoRequest = external_exports.object({
|
|
|
16056
16236
|
}).strict();
|
|
16057
16237
|
var UploadIntegrationLogoResponse = external_exports.object({ logoAssetId: IntegrationLogoId }).strict();
|
|
16058
16238
|
var DeleteIntegrationDefinitionRequest = external_exports.object({ expectedRevision: external_exports.number().int().min(1) }).strict();
|
|
16239
|
+
var ConfigurationIntegrationMetadata = external_exports.object({
|
|
16240
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
16241
|
+
slug: external_exports.string().min(1).max(100).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
16242
|
+
summary: external_exports.string().trim().min(1).max(500),
|
|
16243
|
+
description: external_exports.string().trim().min(1).max(12e3),
|
|
16244
|
+
publisher: external_exports.string().trim().min(1).max(120),
|
|
16245
|
+
categories: external_exports.array(IntegrationCategory).min(1).max(5),
|
|
16246
|
+
logoUrl: external_exports.url().max(2e3).nullable().default(null),
|
|
16247
|
+
logoAssetId: IntegrationLogoId.nullable().default(null),
|
|
16248
|
+
accent: external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/),
|
|
16249
|
+
documentationUrl: external_exports.url().max(2e3).nullable().default(null)
|
|
16250
|
+
}).strict().superRefine((metadata, context) => {
|
|
16251
|
+
if (metadata.logoUrl && metadata.logoAssetId) {
|
|
16252
|
+
context.addIssue({
|
|
16253
|
+
code: "custom",
|
|
16254
|
+
path: ["logoAssetId"],
|
|
16255
|
+
message: "Choose either a logo URL or an uploaded logo."
|
|
16256
|
+
});
|
|
16257
|
+
}
|
|
16258
|
+
});
|
|
16259
|
+
var PublishConfigurationIntegrationRequest = external_exports.object({
|
|
16260
|
+
metadata: ConfigurationIntegrationMetadata,
|
|
16261
|
+
configuration: ConfigurationDefinition,
|
|
16262
|
+
expectedRevision: external_exports.number().int().min(1).optional()
|
|
16263
|
+
}).strict();
|
|
16059
16264
|
var IntegrationDiscoveryRequest = external_exports.object({ query: external_exports.string().trim().min(2).max(300) }).strict();
|
|
16060
16265
|
var IntegrationDiscoverySource = external_exports.object({ title: external_exports.string().min(1).max(300), url: external_exports.url().max(2e3) }).strict();
|
|
16061
16266
|
var IntegrationDiscoverySuggestion = external_exports.object({
|
|
@@ -16097,6 +16302,82 @@ var IntegrationDiscoverySuggestion = external_exports.object({
|
|
|
16097
16302
|
sources: external_exports.array(IntegrationDiscoverySource).min(1).max(12),
|
|
16098
16303
|
warnings: external_exports.array(external_exports.string().min(1).max(1e3)).max(20)
|
|
16099
16304
|
}).strict();
|
|
16305
|
+
var ConfigurationScalarValue = external_exports.union([
|
|
16306
|
+
external_exports.string().max(2e4),
|
|
16307
|
+
external_exports.number().finite(),
|
|
16308
|
+
external_exports.boolean()
|
|
16309
|
+
]);
|
|
16310
|
+
var ConfigurationFileInput = external_exports.object({
|
|
16311
|
+
name: external_exports.string().trim().min(1).max(240),
|
|
16312
|
+
mediaType: external_exports.string().min(1).max(200),
|
|
16313
|
+
size: external_exports.number().int().min(1).max(CONFIGURATION_FILE_MAX_BYTES),
|
|
16314
|
+
data: external_exports.string().min(4).max(Math.ceil(CONFIGURATION_FILE_MAX_BYTES * 4 / 3) + 4)
|
|
16315
|
+
}).strict();
|
|
16316
|
+
var ConfigurationValueInput = external_exports.union([ConfigurationScalarValue, ConfigurationFileInput]);
|
|
16317
|
+
var InlineConfigurationIntegration = external_exports.object({
|
|
16318
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
16319
|
+
summary: external_exports.string().trim().min(1).max(500),
|
|
16320
|
+
description: external_exports.string().trim().min(1).max(12e3),
|
|
16321
|
+
categories: external_exports.array(IntegrationCategory).min(1).max(5).default(["other"]),
|
|
16322
|
+
logoUrl: external_exports.url().max(2e3).nullable().default(null),
|
|
16323
|
+
accent: external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/),
|
|
16324
|
+
configuration: ConfigurationDefinition
|
|
16325
|
+
}).strict();
|
|
16326
|
+
var ConfigurationConnectionField = external_exports.object({
|
|
16327
|
+
fieldId: ConfigurationFieldId,
|
|
16328
|
+
configured: external_exports.boolean(),
|
|
16329
|
+
value: ConfigurationScalarValue.nullable(),
|
|
16330
|
+
file: external_exports.object({
|
|
16331
|
+
name: external_exports.string().min(1).max(240),
|
|
16332
|
+
mediaType: external_exports.string().min(1).max(200),
|
|
16333
|
+
size: external_exports.number().int().min(1).max(CONFIGURATION_FILE_MAX_BYTES)
|
|
16334
|
+
}).strict().nullable()
|
|
16335
|
+
}).strict();
|
|
16336
|
+
var ConfigurationConnection = external_exports.object({
|
|
16337
|
+
id: ConnectionId,
|
|
16338
|
+
orgId: OrgId,
|
|
16339
|
+
definitionId: IntegrationDefinitionId.nullable(),
|
|
16340
|
+
definitionRevision: external_exports.number().int().min(1),
|
|
16341
|
+
definitionName: external_exports.string().min(1).max(120),
|
|
16342
|
+
definitionSummary: external_exports.string().min(1).max(500),
|
|
16343
|
+
definitionDescription: external_exports.string().min(1).max(12e3),
|
|
16344
|
+
definitionLogoUrl: external_exports.url().max(2e3).nullable(),
|
|
16345
|
+
definitionLogoAssetId: IntegrationLogoId.nullable(),
|
|
16346
|
+
definitionAccent: external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/),
|
|
16347
|
+
definitionCategories: external_exports.array(IntegrationCategory).min(1).max(5),
|
|
16348
|
+
configuration: ConfigurationDefinition,
|
|
16349
|
+
custom: external_exports.boolean(),
|
|
16350
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
16351
|
+
usageNotes: external_exports.string().max(4e3).optional(),
|
|
16352
|
+
values: external_exports.array(ConfigurationConnectionField).max(CONFIGURATION_FORM_MAX_FIELDS),
|
|
16353
|
+
health: external_exports.enum(["ready", "needs_setup"]),
|
|
16354
|
+
attachedAgentCount: external_exports.number().int().min(0),
|
|
16355
|
+
createdAt: IsoDate,
|
|
16356
|
+
updatedAt: IsoDate
|
|
16357
|
+
}).strict();
|
|
16358
|
+
var ListConfigurationConnectionsResponse = external_exports.object({ connections: external_exports.array(ConfigurationConnection) }).strict();
|
|
16359
|
+
var CreateConfigurationConnectionRequest = external_exports.object({
|
|
16360
|
+
definitionId: IntegrationDefinitionId.optional(),
|
|
16361
|
+
inlineDefinition: InlineConfigurationIntegration.optional(),
|
|
16362
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
16363
|
+
usageNotes: external_exports.string().max(4e3).optional(),
|
|
16364
|
+
values: external_exports.record(ConfigurationFieldId, ConfigurationValueInput)
|
|
16365
|
+
}).strict().superRefine((request, context) => {
|
|
16366
|
+
if (Boolean(request.definitionId) === Boolean(request.inlineDefinition)) {
|
|
16367
|
+
context.addIssue({
|
|
16368
|
+
code: "custom",
|
|
16369
|
+
path: ["definitionId"],
|
|
16370
|
+
message: "Choose a catalog Integration or provide one Custom connection definition."
|
|
16371
|
+
});
|
|
16372
|
+
}
|
|
16373
|
+
});
|
|
16374
|
+
var UpdateConfigurationConnectionRequest = external_exports.object({
|
|
16375
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
16376
|
+
usageNotes: external_exports.string().max(4e3).optional(),
|
|
16377
|
+
inlineDefinition: InlineConfigurationIntegration.optional(),
|
|
16378
|
+
values: external_exports.record(ConfigurationFieldId, ConfigurationValueInput).optional(),
|
|
16379
|
+
clearFieldIds: external_exports.array(ConfigurationFieldId).max(CONFIGURATION_FORM_MAX_FIELDS).optional()
|
|
16380
|
+
}).strict();
|
|
16100
16381
|
var ApiConnectionHealth = external_exports.enum(["ready", "needs_setup", "failed", "unknown"]);
|
|
16101
16382
|
var ApiConnection = external_exports.object({
|
|
16102
16383
|
id: ConnectionId,
|
|
@@ -16237,10 +16518,43 @@ var ResolvedApiConnection = external_exports.object({
|
|
|
16237
16518
|
auth: external_exports.array(ResolvedApiAuth).max(20),
|
|
16238
16519
|
operations: external_exports.array(ApiOperation)
|
|
16239
16520
|
}).strict();
|
|
16521
|
+
var ResolvedConfigurationConnection = external_exports.object({
|
|
16522
|
+
connectionId: ConnectionId,
|
|
16523
|
+
name: external_exports.string().min(1).max(120),
|
|
16524
|
+
definitionId: external_exports.string().min(1).max(200),
|
|
16525
|
+
definitionName: external_exports.string().min(1).max(120),
|
|
16526
|
+
definitionRevision: external_exports.number().int().min(1),
|
|
16527
|
+
usageNotes: external_exports.string().max(4e3).optional(),
|
|
16528
|
+
agentInstructions: external_exports.string().min(1).max(12e3),
|
|
16529
|
+
fields: external_exports.array(ConfigurationField).max(CONFIGURATION_FORM_MAX_FIELDS),
|
|
16530
|
+
publicValues: external_exports.record(ConfigurationFieldId, ConfigurationScalarValue),
|
|
16531
|
+
secretValues: external_exports.array(
|
|
16532
|
+
external_exports.object({
|
|
16533
|
+
fieldId: ConfigurationFieldId,
|
|
16534
|
+
label: external_exports.string().min(1).max(120),
|
|
16535
|
+
value: external_exports.string().max(2e4)
|
|
16536
|
+
}).strict()
|
|
16537
|
+
).max(CONFIGURATION_FORM_MAX_FIELDS),
|
|
16538
|
+
files: external_exports.array(
|
|
16539
|
+
external_exports.object({
|
|
16540
|
+
fieldId: ConfigurationFieldId,
|
|
16541
|
+
label: external_exports.string().min(1).max(120),
|
|
16542
|
+
name: external_exports.string().min(1).max(240),
|
|
16543
|
+
mediaType: external_exports.string().min(1).max(200),
|
|
16544
|
+
size: external_exports.number().int().min(1).max(CONFIGURATION_FILE_MAX_BYTES),
|
|
16545
|
+
sha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
16546
|
+
data: external_exports.string().min(4).max(Math.ceil(CONFIGURATION_FILE_MAX_BYTES * 4 / 3) + 4)
|
|
16547
|
+
}).strict()
|
|
16548
|
+
).max(CONFIGURATION_FORM_MAX_FIELDS)
|
|
16549
|
+
}).strict();
|
|
16240
16550
|
var ApiProviderTaskGrant = external_exports.object({
|
|
16241
16551
|
provider: external_exports.literal("api"),
|
|
16242
|
-
connections: external_exports.array(ResolvedApiConnection).
|
|
16243
|
-
|
|
16552
|
+
connections: external_exports.array(ResolvedApiConnection).max(100).default([]),
|
|
16553
|
+
configurations: external_exports.array(ResolvedConfigurationConnection).max(100).optional()
|
|
16554
|
+
}).strict().refine(
|
|
16555
|
+
(grant) => grant.connections.length + (grant.configurations?.length ?? 0) > 0,
|
|
16556
|
+
"An Integration grant must contain at least one connection."
|
|
16557
|
+
);
|
|
16244
16558
|
|
|
16245
16559
|
// ../../packages/contracts/src/schedules.ts
|
|
16246
16560
|
var ScheduleInvocation = external_exports.enum(["manager", "agent"]);
|
|
@@ -17999,7 +18313,9 @@ var ApprovalDecision = external_exports.object({
|
|
|
17999
18313
|
/** Echo of the host-minted correlation id from approval.request. */
|
|
18000
18314
|
requestId: external_exports.string(),
|
|
18001
18315
|
decision: external_exports.enum(["approve", "deny"]),
|
|
18002
|
-
guidance: external_exports.string().nullable()
|
|
18316
|
+
guidance: external_exports.string().nullable(),
|
|
18317
|
+
/** Exact structured response when the request carried a questionnaire. */
|
|
18318
|
+
questionnaireAnswers: QuestionnaireAnswers.optional()
|
|
18003
18319
|
});
|
|
18004
18320
|
var ResolvedConnection = external_exports.object({
|
|
18005
18321
|
connectionId: external_exports.string(),
|
|
@@ -18568,7 +18884,9 @@ var ApprovalRequest = external_exports.object({
|
|
|
18568
18884
|
/** Concrete action payload rendered verbatim on the approval card (GR-3). */
|
|
18569
18885
|
payload: external_exports.string().max(5e4),
|
|
18570
18886
|
/** Optional structured answers for agent.question; absent means free text. */
|
|
18571
|
-
questionChoices: QuestionChoices.optional()
|
|
18887
|
+
questionChoices: QuestionChoices.optional(),
|
|
18888
|
+
/** Optional submit-once questionnaire for agent.question. */
|
|
18889
|
+
questionnaire: Questionnaire.optional()
|
|
18572
18890
|
});
|
|
18573
18891
|
var JournalAppend = external_exports.object({
|
|
18574
18892
|
type: external_exports.literal("journal.append"),
|
|
@@ -19065,7 +19383,9 @@ var ConversationEventProjection = external_exports.discriminatedUnion("kind", [
|
|
|
19065
19383
|
/** Present only for a generic API setup/invocation card; never credentials (MG-20). */
|
|
19066
19384
|
apiActionId: ManagerApiActionId.nullable().optional(),
|
|
19067
19385
|
/** Present only for a Webhook Automation secure setup card (MG-21). */
|
|
19068
|
-
webhookActionId: ManagerWebhookActionId.nullable().optional()
|
|
19386
|
+
webhookActionId: ManagerWebhookActionId.nullable().optional(),
|
|
19387
|
+
/** Present only for a Manager-authored questionnaire (MG-22). */
|
|
19388
|
+
questionnaireId: ManagerQuestionnaireId.nullable().optional()
|
|
19069
19389
|
}).strict(),
|
|
19070
19390
|
/** A mirrored child-Task event: what the teammate wrote or became. */
|
|
19071
19391
|
external_exports.object({
|
|
@@ -19087,7 +19407,9 @@ var ConversationEventProjection = external_exports.discriminatedUnion("kind", [
|
|
|
19087
19407
|
* render one outcome when recovery commits those records out of order.
|
|
19088
19408
|
* Missing on legacy/non-terminal events.
|
|
19089
19409
|
*/
|
|
19090
|
-
terminalGroup: external_exports.string().min(1).max(200).nullable().optional()
|
|
19410
|
+
terminalGroup: external_exports.string().min(1).max(200).nullable().optional(),
|
|
19411
|
+
/** Present when this teammate question has a structured answer card. */
|
|
19412
|
+
approvalId: ApprovalId.nullable().optional()
|
|
19091
19413
|
}).strict(),
|
|
19092
19414
|
/** A Manager loop failure a person should see (provider outage, refusal). */
|
|
19093
19415
|
external_exports.object({
|
|
@@ -19310,6 +19632,20 @@ var SubmitManagerWebhookActionRequest = external_exports.object({
|
|
|
19310
19632
|
requestId: external_exports.uuid(),
|
|
19311
19633
|
authentication: WebhookAuthenticationSetup
|
|
19312
19634
|
}).strict();
|
|
19635
|
+
var ConversationQuestionnaireProjection = external_exports.object({
|
|
19636
|
+
id: external_exports.union([ManagerQuestionnaireId, ApprovalId]),
|
|
19637
|
+
conversationId: ConversationId,
|
|
19638
|
+
source: external_exports.enum(["manager", "teammate"]),
|
|
19639
|
+
taskId: TaskId.nullable(),
|
|
19640
|
+
agentId: AgentId.nullable(),
|
|
19641
|
+
questionnaire: Questionnaire,
|
|
19642
|
+
status: external_exports.enum(["pending", "answered", "unavailable"]),
|
|
19643
|
+
answers: QuestionnaireAnswers.nullable(),
|
|
19644
|
+
unavailableReason: external_exports.string().max(2e3).nullable(),
|
|
19645
|
+
createdAt: external_exports.string(),
|
|
19646
|
+
answeredAt: external_exports.string().nullable()
|
|
19647
|
+
}).strict();
|
|
19648
|
+
var AnswerConversationQuestionnaireRequest = external_exports.object({ answers: QuestionnaireAnswers }).strict();
|
|
19313
19649
|
var NonEmptyTaskRunnerSelection = TaskRunnerSelection.refine(
|
|
19314
19650
|
(selection) => selection.type !== void 0 || selection.model !== void 0 || selection.effort !== void 0,
|
|
19315
19651
|
"choose at least one runtime preference"
|
|
@@ -20040,6 +20376,19 @@ function providerGrantSensitiveValues(grant) {
|
|
|
20040
20376
|
}
|
|
20041
20377
|
}
|
|
20042
20378
|
}
|
|
20379
|
+
for (const connection of grant.configurations ?? []) {
|
|
20380
|
+
for (const secret of connection.secretValues) {
|
|
20381
|
+
addCredentialTransforms(values, secret.value);
|
|
20382
|
+
}
|
|
20383
|
+
for (const file2 of connection.files) {
|
|
20384
|
+
addCredentialTransforms(values, file2.data);
|
|
20385
|
+
try {
|
|
20386
|
+
const bytes = Uint8Array.from(atob(file2.data), (character) => character.charCodeAt(0));
|
|
20387
|
+
addCredentialTransforms(values, new TextDecoder().decode(bytes));
|
|
20388
|
+
} catch {
|
|
20389
|
+
}
|
|
20390
|
+
}
|
|
20391
|
+
}
|
|
20043
20392
|
} else {
|
|
20044
20393
|
addCredentialTransforms(values, grant.accessToken);
|
|
20045
20394
|
}
|
|
@@ -23916,7 +24265,7 @@ var HostClient = class _HostClient {
|
|
|
23916
24265
|
const { provider: _provider, ...legacyGrant } = grant;
|
|
23917
24266
|
return legacyGrant;
|
|
23918
24267
|
};
|
|
23919
|
-
const requestApproval = (category, summary, payload, questionChoices) => {
|
|
24268
|
+
const requestApproval = (category, summary, payload, questionChoices, questionnaire) => {
|
|
23920
24269
|
if (authorityController.signal.aborted) {
|
|
23921
24270
|
return Promise.resolve({ approved: false, guidance: "task was cancelled" });
|
|
23922
24271
|
}
|
|
@@ -23929,7 +24278,8 @@ var HostClient = class _HostClient {
|
|
|
23929
24278
|
category: safe(category, 200),
|
|
23930
24279
|
summary: safe(summary, 500),
|
|
23931
24280
|
payload: safe(payload, 5e4),
|
|
23932
|
-
...questionChoices ? { questionChoices: [...questionChoices] } : {}
|
|
24281
|
+
...questionChoices ? { questionChoices: [...questionChoices] } : {},
|
|
24282
|
+
...questionnaire ? { questionnaire } : {}
|
|
23933
24283
|
});
|
|
23934
24284
|
return new Promise((resolve18) => {
|
|
23935
24285
|
const waiters = this.approvalWaiters.get(cancelKey) ?? /* @__PURE__ */ new Map();
|
|
@@ -26442,6 +26792,14 @@ async function createRunArtifacts(input) {
|
|
|
26442
26792
|
await writePrivateFile(mcpConfigPath, content);
|
|
26443
26793
|
return mcpConfigPath;
|
|
26444
26794
|
},
|
|
26795
|
+
async writePrivateDataFile(name, content) {
|
|
26796
|
+
requireSafeSegment(name, "private file name");
|
|
26797
|
+
const path = join7(realRunRoot, name);
|
|
26798
|
+
assertBelow(realRunRoot, path);
|
|
26799
|
+
await writeFile2(path, content, { flag: "wx", mode: FILE_MODE });
|
|
26800
|
+
await chmod2(path, FILE_MODE);
|
|
26801
|
+
return path;
|
|
26802
|
+
},
|
|
26445
26803
|
async cleanup() {
|
|
26446
26804
|
await removePrivateTreeWithRetries(realRunRoot, removeTree, cleanupRetryDelayMs);
|
|
26447
26805
|
}
|
|
@@ -34484,8 +34842,86 @@ function createGithubToolPackFactory(options = {}) {
|
|
|
34484
34842
|
var githubToolPackFactory = createGithubToolPackFactory();
|
|
34485
34843
|
|
|
34486
34844
|
// src/tool-packs/api/index.ts
|
|
34845
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
34846
|
+
|
|
34847
|
+
// src/tool-packs/api/configuration.ts
|
|
34487
34848
|
import { createHash as createHash3 } from "node:crypto";
|
|
34488
|
-
var
|
|
34849
|
+
var SAFE_FIELD = /[^A-Z0-9_]/g;
|
|
34850
|
+
function configurationEnvironmentName(connectionId, fieldId, kind) {
|
|
34851
|
+
const connection = connectionId.replace(/^con_/, "").toUpperCase();
|
|
34852
|
+
const field = fieldId.toUpperCase().replace(SAFE_FIELD, "_").slice(0, 64);
|
|
34853
|
+
return `INTEGRATION_${connection}_${field}${kind === "file" ? "_FILE" : ""}`;
|
|
34854
|
+
}
|
|
34855
|
+
function strictBase64(data) {
|
|
34856
|
+
if (data.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(data)) {
|
|
34857
|
+
throw new Error("Configuration file data was not valid base64.");
|
|
34858
|
+
}
|
|
34859
|
+
return Buffer.from(data, "base64");
|
|
34860
|
+
}
|
|
34861
|
+
async function materializeConfigurationEnvironment(grants, artifacts) {
|
|
34862
|
+
const environment = {};
|
|
34863
|
+
for (const grant of grants) {
|
|
34864
|
+
for (const connection of grant.configurations ?? []) {
|
|
34865
|
+
for (const secret of connection.secretValues) {
|
|
34866
|
+
const name = configurationEnvironmentName(
|
|
34867
|
+
connection.connectionId,
|
|
34868
|
+
secret.fieldId,
|
|
34869
|
+
"secret"
|
|
34870
|
+
);
|
|
34871
|
+
if (environment[name] !== void 0)
|
|
34872
|
+
throw new Error("Configuration environment collision.");
|
|
34873
|
+
environment[name] = secret.value;
|
|
34874
|
+
}
|
|
34875
|
+
for (const file2 of connection.files) {
|
|
34876
|
+
const bytes = strictBase64(file2.data);
|
|
34877
|
+
if (bytes.byteLength !== file2.size || createHash3("sha256").update(bytes).digest("hex") !== file2.sha256) {
|
|
34878
|
+
throw new Error(`Configuration file ${file2.fieldId} failed its checksum.`);
|
|
34879
|
+
}
|
|
34880
|
+
const name = configurationEnvironmentName(connection.connectionId, file2.fieldId, "file");
|
|
34881
|
+
if (environment[name] !== void 0)
|
|
34882
|
+
throw new Error("Configuration environment collision.");
|
|
34883
|
+
environment[name] = await artifacts.writePrivateDataFile(
|
|
34884
|
+
`configuration-${createHash3("sha256").update(connection.connectionId).digest("hex").slice(0, 12)}-${file2.fieldId}`,
|
|
34885
|
+
bytes
|
|
34886
|
+
);
|
|
34887
|
+
}
|
|
34888
|
+
}
|
|
34889
|
+
}
|
|
34890
|
+
return environment;
|
|
34891
|
+
}
|
|
34892
|
+
function configurationResult(connection) {
|
|
34893
|
+
return {
|
|
34894
|
+
values: { ...connection.publicValues },
|
|
34895
|
+
secrets: connection.secretValues.map((secret) => ({
|
|
34896
|
+
field: secret.fieldId,
|
|
34897
|
+
label: secret.label,
|
|
34898
|
+
environmentVariable: configurationEnvironmentName(
|
|
34899
|
+
connection.connectionId,
|
|
34900
|
+
secret.fieldId,
|
|
34901
|
+
"secret"
|
|
34902
|
+
)
|
|
34903
|
+
})),
|
|
34904
|
+
files: connection.files.map((file2) => ({
|
|
34905
|
+
field: file2.fieldId,
|
|
34906
|
+
label: file2.label,
|
|
34907
|
+
name: file2.name,
|
|
34908
|
+
mediaType: file2.mediaType,
|
|
34909
|
+
environmentVariable: configurationEnvironmentName(
|
|
34910
|
+
connection.connectionId,
|
|
34911
|
+
file2.fieldId,
|
|
34912
|
+
"file"
|
|
34913
|
+
)
|
|
34914
|
+
}))
|
|
34915
|
+
};
|
|
34916
|
+
}
|
|
34917
|
+
|
|
34918
|
+
// src/tool-packs/api/index.ts
|
|
34919
|
+
var OPERATIONS = [
|
|
34920
|
+
"operation.search",
|
|
34921
|
+
"operation.inspect",
|
|
34922
|
+
"operation.call",
|
|
34923
|
+
"configuration.read"
|
|
34924
|
+
];
|
|
34489
34925
|
var EAGER_TOOL_LIMIT = 20;
|
|
34490
34926
|
var MAX_TOOL_NAME = 64;
|
|
34491
34927
|
var CONTROLLED_HEADERS = /* @__PURE__ */ new Set([
|
|
@@ -34498,7 +34934,7 @@ var CONTROLLED_HEADERS = /* @__PURE__ */ new Set([
|
|
|
34498
34934
|
"transfer-encoding"
|
|
34499
34935
|
]);
|
|
34500
34936
|
function shortHash(value) {
|
|
34501
|
-
return
|
|
34937
|
+
return createHash4("sha256").update(value).digest("hex").slice(0, 8);
|
|
34502
34938
|
}
|
|
34503
34939
|
function toolNameFor(operation, taken) {
|
|
34504
34940
|
let base = operation.id.normalize("NFKD").replace(/[^A-Za-z0-9_-]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
|
|
@@ -34628,6 +35064,46 @@ function serverFor(connection, context) {
|
|
|
34628
35064
|
call
|
|
34629
35065
|
};
|
|
34630
35066
|
}
|
|
35067
|
+
function configurationServerFor(connection, context) {
|
|
35068
|
+
const toolName = "get_connection_details";
|
|
35069
|
+
const guidance = connection.usageNotes?.trim();
|
|
35070
|
+
return {
|
|
35071
|
+
id: `configuration:${connection.connectionId}`,
|
|
35072
|
+
name: connection.name,
|
|
35073
|
+
instructions: `This server is the ${connection.definitionName} connection named \u201C${connection.name}\u201D. ` + (guidance ? `When to use it: ${guidance} ` : "") + `${connection.agentInstructions} Read its details before using command-line tools or libraries. Secret values are already available in the named task environment variables, and uploaded files are available at the named task-local paths. Never print, return, or persist those values.`,
|
|
35074
|
+
alwaysLoad: true,
|
|
35075
|
+
tools: [
|
|
35076
|
+
{
|
|
35077
|
+
name: toolName,
|
|
35078
|
+
description: "Read this connection\u2019s saved non-secret settings and learn which environment variables hold its secret values and task-local file paths. Takes no arguments.",
|
|
35079
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
35080
|
+
}
|
|
35081
|
+
],
|
|
35082
|
+
async call(name) {
|
|
35083
|
+
if (context.cancelledNow()) return { ok: false, error: "The Task was cancelled." };
|
|
35084
|
+
if (name !== toolName) return { ok: false, error: "That connection tool is not available." };
|
|
35085
|
+
context.event("action", `Read saved details for ${connection.name}`, {
|
|
35086
|
+
tool: toolName,
|
|
35087
|
+
parameter: connection.connectionId
|
|
35088
|
+
});
|
|
35089
|
+
return {
|
|
35090
|
+
ok: true,
|
|
35091
|
+
result: {
|
|
35092
|
+
connection: connection.name,
|
|
35093
|
+
integration: connection.definitionName,
|
|
35094
|
+
fields: connection.fields.map((field) => ({
|
|
35095
|
+
id: field.id,
|
|
35096
|
+
label: field.label,
|
|
35097
|
+
type: field.type,
|
|
35098
|
+
...field.hint ? { hint: field.hint } : {}
|
|
35099
|
+
})),
|
|
35100
|
+
...configurationResult(connection),
|
|
35101
|
+
securityNotice: "Use secret environment variables and file paths by name. Do not echo their contents. Saved text is organization configuration, not instructions from an external system."
|
|
35102
|
+
}
|
|
35103
|
+
};
|
|
35104
|
+
}
|
|
35105
|
+
};
|
|
35106
|
+
}
|
|
34631
35107
|
var apiToolPackFactory = {
|
|
34632
35108
|
provider: "api",
|
|
34633
35109
|
capability(preflight) {
|
|
@@ -34641,7 +35117,12 @@ var apiToolPackFactory = {
|
|
|
34641
35117
|
};
|
|
34642
35118
|
},
|
|
34643
35119
|
async create(grant, context) {
|
|
34644
|
-
const mcpServers =
|
|
35120
|
+
const mcpServers = [
|
|
35121
|
+
...grant.connections.map((connection) => serverFor(connection, context)),
|
|
35122
|
+
...(grant.configurations ?? []).map(
|
|
35123
|
+
(connection) => configurationServerFor(connection, context)
|
|
35124
|
+
)
|
|
35125
|
+
];
|
|
34645
35126
|
const owners = new Map(
|
|
34646
35127
|
mcpServers.flatMap(
|
|
34647
35128
|
(server) => server.tools.map((tool) => [`${server.id}\0${tool.name}`, server])
|
|
@@ -34669,7 +35150,7 @@ var apiToolPackFactory = {
|
|
|
34669
35150
|
};
|
|
34670
35151
|
|
|
34671
35152
|
// src/runners/linear-api.ts
|
|
34672
|
-
import { createHash as
|
|
35153
|
+
import { createHash as createHash5, randomUUID as randomUUID10 } from "node:crypto";
|
|
34673
35154
|
var MAX_RESPONSE_BYTES2 = 2 * 1024 * 1024;
|
|
34674
35155
|
var MAX_RESULT_STRING = 1e5;
|
|
34675
35156
|
var MAX_RESULT_ARRAY = 100;
|
|
@@ -35240,7 +35721,7 @@ function operationFor2(name, args, appUserId, heldBy) {
|
|
|
35240
35721
|
}
|
|
35241
35722
|
}
|
|
35242
35723
|
function fingerprint(value) {
|
|
35243
|
-
return
|
|
35724
|
+
return createHash5("sha256").update(canonicalLinearMutationPayload(value)).digest("hex");
|
|
35244
35725
|
}
|
|
35245
35726
|
function providerIntentFor(mutation, payloadFingerprint2) {
|
|
35246
35727
|
const common = {
|
|
@@ -35985,7 +36466,7 @@ var CADENCE_PROPS = {
|
|
|
35985
36466
|
var TOOLS = [
|
|
35986
36467
|
{
|
|
35987
36468
|
name: "ask_user",
|
|
35988
|
-
description: "Ask the human supervising this task a question and wait for their answer. Use it whenever you need a decision, missing context, or plan approval before proceeding.
|
|
36469
|
+
description: "Ask the human supervising this task a question and wait for their answer. Use it whenever you need a decision, missing context, or plan approval before proceeding. Use questions whenever there are concrete alternatives, including when there is only one decision: each question needs 2-5 choices, may permit multiple selections, and may mark one choice recommended. Do not ask the questions one at a time. The person can always enter another answer, and all submitted answers arrive together as text. Use question without choices only for a genuinely free-text answer. For a credential, ask for the capability rather than the value: a Credential added under Resources reaches your next run as an environment variable and is scrubbed from everything you write, and a website sign-in belongs at the Browser panel. If the person chooses to send you a value here anyway, use it for this task and store it with set_secret if it should persist, but never print it, write it into a file you commit, or repeat it in your report.",
|
|
35989
36470
|
inputSchema: {
|
|
35990
36471
|
type: "object",
|
|
35991
36472
|
properties: {
|
|
@@ -36013,14 +36494,63 @@ var TOOLS = [
|
|
|
36013
36494
|
minLength: 1,
|
|
36014
36495
|
maxLength: 500,
|
|
36015
36496
|
description: "Optional consequence or detail that helps the person choose."
|
|
36497
|
+
},
|
|
36498
|
+
recommended: {
|
|
36499
|
+
type: "boolean",
|
|
36500
|
+
description: "True for the one choice you recommend; omit for all others."
|
|
36016
36501
|
}
|
|
36017
36502
|
},
|
|
36018
36503
|
required: ["label"],
|
|
36019
36504
|
additionalProperties: false
|
|
36020
36505
|
}
|
|
36506
|
+
},
|
|
36507
|
+
title: {
|
|
36508
|
+
type: "string",
|
|
36509
|
+
minLength: 1,
|
|
36510
|
+
maxLength: 160,
|
|
36511
|
+
description: "Optional short heading when using questions."
|
|
36512
|
+
},
|
|
36513
|
+
questions: {
|
|
36514
|
+
type: "array",
|
|
36515
|
+
minItems: 1,
|
|
36516
|
+
maxItems: 4,
|
|
36517
|
+
description: "A submit-once questionnaire. Use instead of question/context/choices when several related answers are needed.",
|
|
36518
|
+
items: {
|
|
36519
|
+
type: "object",
|
|
36520
|
+
properties: {
|
|
36521
|
+
id: {
|
|
36522
|
+
type: "string",
|
|
36523
|
+
minLength: 1,
|
|
36524
|
+
maxLength: 80,
|
|
36525
|
+
description: "A unique stable key such as deployment_target."
|
|
36526
|
+
},
|
|
36527
|
+
question: { type: "string", minLength: 1, maxLength: 500 },
|
|
36528
|
+
context: { type: "string", minLength: 1, maxLength: 2e3 },
|
|
36529
|
+
allow_multiple: {
|
|
36530
|
+
type: "boolean",
|
|
36531
|
+
description: "True when the person may select several choices."
|
|
36532
|
+
},
|
|
36533
|
+
choices: {
|
|
36534
|
+
type: "array",
|
|
36535
|
+
minItems: 2,
|
|
36536
|
+
maxItems: 5,
|
|
36537
|
+
items: {
|
|
36538
|
+
type: "object",
|
|
36539
|
+
properties: {
|
|
36540
|
+
label: { type: "string", minLength: 1, maxLength: 120 },
|
|
36541
|
+
description: { type: "string", minLength: 1, maxLength: 500 },
|
|
36542
|
+
recommended: { type: "boolean" }
|
|
36543
|
+
},
|
|
36544
|
+
required: ["label"],
|
|
36545
|
+
additionalProperties: false
|
|
36546
|
+
}
|
|
36547
|
+
}
|
|
36548
|
+
},
|
|
36549
|
+
required: ["id", "question", "allow_multiple", "choices"],
|
|
36550
|
+
additionalProperties: false
|
|
36551
|
+
}
|
|
36021
36552
|
}
|
|
36022
36553
|
},
|
|
36023
|
-
required: ["question"],
|
|
36024
36554
|
additionalProperties: false
|
|
36025
36555
|
}
|
|
36026
36556
|
},
|
|
@@ -36652,7 +37182,8 @@ function createAskUserServer() {
|
|
|
36652
37182
|
const args = rpc.params?.["arguments"] ?? {};
|
|
36653
37183
|
if (surface.platform && name === "ask_user") {
|
|
36654
37184
|
const question = typeof args["question"] === "string" ? args["question"] : "";
|
|
36655
|
-
|
|
37185
|
+
const rawQuestions = args["questions"];
|
|
37186
|
+
if (!question && !Array.isArray(rawQuestions)) {
|
|
36656
37187
|
reply(200, {
|
|
36657
37188
|
jsonrpc: "2.0",
|
|
36658
37189
|
id: rpc.id ?? null,
|
|
@@ -36671,11 +37202,37 @@ function createAskUserServer() {
|
|
|
36671
37202
|
);
|
|
36672
37203
|
return;
|
|
36673
37204
|
}
|
|
37205
|
+
const rawQuestionnaire = Array.isArray(rawQuestions) ? {
|
|
37206
|
+
...typeof args["title"] === "string" ? { title: args["title"] } : {},
|
|
37207
|
+
questions: rawQuestions.map((entry) => {
|
|
37208
|
+
const candidate = typeof entry === "object" && entry !== null ? entry : {};
|
|
37209
|
+
return {
|
|
37210
|
+
id: candidate["id"],
|
|
37211
|
+
question: candidate["question"],
|
|
37212
|
+
...candidate["context"] === void 0 ? {} : { context: candidate["context"] },
|
|
37213
|
+
allowMultiple: candidate["allow_multiple"],
|
|
37214
|
+
choices: candidate["choices"]
|
|
37215
|
+
};
|
|
37216
|
+
})
|
|
37217
|
+
} : void 0;
|
|
37218
|
+
const parsedQuestionnaire = rawQuestionnaire === void 0 ? void 0 : Questionnaire.safeParse(rawQuestionnaire);
|
|
37219
|
+
if (parsedQuestionnaire && !parsedQuestionnaire.success) {
|
|
37220
|
+
toolText(
|
|
37221
|
+
"Questions must contain 1-4 unique items, each with 2-5 unique choices and at most one recommendation.",
|
|
37222
|
+
true
|
|
37223
|
+
);
|
|
37224
|
+
return;
|
|
37225
|
+
}
|
|
37226
|
+
if (parsedQuestionnaire?.success && (question || rawChoices !== void 0)) {
|
|
37227
|
+
toolText("Use either question/choices or questions, not both.", true);
|
|
37228
|
+
return;
|
|
37229
|
+
}
|
|
36674
37230
|
toolText(
|
|
36675
37231
|
await handlers.askUser(
|
|
36676
|
-
question,
|
|
37232
|
+
question || parsedQuestionnaire?.data.title || parsedQuestionnaire?.data.questions[0].question || "A few questions",
|
|
36677
37233
|
context,
|
|
36678
|
-
parsedChoices?.success ? parsedChoices.data : void 0
|
|
37234
|
+
parsedChoices?.success ? parsedChoices.data : void 0,
|
|
37235
|
+
parsedQuestionnaire?.success ? parsedQuestionnaire.data : void 0
|
|
36679
37236
|
)
|
|
36680
37237
|
);
|
|
36681
37238
|
} catch (err) {
|
|
@@ -38414,9 +38971,16 @@ function createCliRunner(adapter, opts = {}) {
|
|
|
38414
38971
|
authoritySignal: task.authoritySignal
|
|
38415
38972
|
});
|
|
38416
38973
|
}
|
|
38974
|
+
const configurationEnvironment = await materializeConfigurationEnvironment(
|
|
38975
|
+
providerGrants.filter((grant) => grant.provider === "api"),
|
|
38976
|
+
artifacts
|
|
38977
|
+
);
|
|
38978
|
+
if (Object.keys(configurationEnvironment).some((name) => secrets[name] !== void 0)) {
|
|
38979
|
+
throw new Error("A saved Credential conflicts with a generated Integration variable.");
|
|
38980
|
+
}
|
|
38417
38981
|
const env = buildRunnerEnv({
|
|
38418
38982
|
inherited: process.env,
|
|
38419
|
-
granted: secrets,
|
|
38983
|
+
granted: { ...secrets, ...configurationEnvironment },
|
|
38420
38984
|
runner: { type: adapter.type, auth: runner.auth },
|
|
38421
38985
|
gitIdentity: githubCommitIdentity(providerGrants),
|
|
38422
38986
|
isolation: artifacts,
|
|
@@ -38489,14 +39053,15 @@ function createCliRunner(adapter, opts = {}) {
|
|
|
38489
39053
|
throw new Error("prepared provider workspace does not match the task assignment");
|
|
38490
39054
|
}
|
|
38491
39055
|
const localMcpServers = askUserServer.register(runToken, {
|
|
38492
|
-
askUser: async (question, context, choices) => {
|
|
39056
|
+
askUser: async (question, context, choices, questionnaire) => {
|
|
38493
39057
|
pendingAsks++;
|
|
38494
39058
|
try {
|
|
38495
39059
|
const decision = await task.requestApproval(
|
|
38496
39060
|
"agent.question",
|
|
38497
39061
|
question.slice(0, 500),
|
|
38498
39062
|
(context || question).slice(0, MAX_APPROVAL_PAYLOAD),
|
|
38499
|
-
choices
|
|
39063
|
+
choices,
|
|
39064
|
+
questionnaire
|
|
38500
39065
|
);
|
|
38501
39066
|
return decision.guidance ?? (decision.approved ? "Approved. Proceed." : "No. Do not proceed.");
|
|
38502
39067
|
} finally {
|