@zixt/host 0.0.101 → 0.0.103
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 +340 -148
- 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.103",
|
|
32
32
|
type: "module",
|
|
33
33
|
exports: {
|
|
34
34
|
".": "./src/client.ts",
|
|
@@ -14670,6 +14670,10 @@ var ID_PREFIXES = {
|
|
|
14670
14670
|
managerCredentialRequest: "mcr",
|
|
14671
14671
|
/** One Manager-prepared generic API setup or invocation card (MG-20). */
|
|
14672
14672
|
managerApiAction: "maa",
|
|
14673
|
+
/** One Manager-prepared Webhook Automation setup card (MG-21). */
|
|
14674
|
+
managerWebhookAction: "mwa",
|
|
14675
|
+
/** One Manager-authored questionnaire waiting in a Conversation. */
|
|
14676
|
+
managerQuestionnaire: "mqu",
|
|
14673
14677
|
/** One Manager inference call's token-metering row (MG-8). */
|
|
14674
14678
|
managerUsage: "mgu",
|
|
14675
14679
|
/** One ordered Manager reply awaiting Slack delivery. */
|
|
@@ -14733,6 +14737,14 @@ var ManagerCredentialRequestId = idSchema(
|
|
|
14733
14737
|
"Manager credential request id"
|
|
14734
14738
|
);
|
|
14735
14739
|
var ManagerApiActionId = idSchema(ID_PREFIXES.managerApiAction, "Manager API action id");
|
|
14740
|
+
var ManagerWebhookActionId = idSchema(
|
|
14741
|
+
ID_PREFIXES.managerWebhookAction,
|
|
14742
|
+
"Manager webhook action id"
|
|
14743
|
+
);
|
|
14744
|
+
var ManagerQuestionnaireId = idSchema(
|
|
14745
|
+
ID_PREFIXES.managerQuestionnaire,
|
|
14746
|
+
"Manager questionnaire id"
|
|
14747
|
+
);
|
|
14736
14748
|
var ManagerEmailInboxId = idSchema(
|
|
14737
14749
|
ID_PREFIXES.managerEmailInbox,
|
|
14738
14750
|
"Manager email inbox id"
|
|
@@ -14976,7 +14988,9 @@ var MemberApprovalRequestContext = ApprovalRequestContext.extend({
|
|
|
14976
14988
|
});
|
|
14977
14989
|
var QuestionChoice = external_exports.object({
|
|
14978
14990
|
label: external_exports.string().trim().min(1).max(120),
|
|
14979
|
-
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()
|
|
14980
14994
|
}).strict();
|
|
14981
14995
|
var QuestionChoices = external_exports.array(QuestionChoice).min(2).max(5).superRefine((choices, ctx) => {
|
|
14982
14996
|
const labels = choices.map(({ label }) => label.toLocaleLowerCase());
|
|
@@ -14984,6 +14998,38 @@ var QuestionChoices = external_exports.array(QuestionChoice).min(2).max(5).super
|
|
|
14984
14998
|
ctx.addIssue({ code: "custom", message: "question choice labels must be unique" });
|
|
14985
14999
|
}
|
|
14986
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);
|
|
14987
15033
|
var Approval = external_exports.object({
|
|
14988
15034
|
id: ApprovalId,
|
|
14989
15035
|
orgId: OrgId,
|
|
@@ -14996,6 +15042,10 @@ var Approval = external_exports.object({
|
|
|
14996
15042
|
payload: external_exports.string().max(5e4),
|
|
14997
15043
|
/** Present only when ask_user supplied a bounded multiple-choice question. */
|
|
14998
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(),
|
|
14999
15049
|
status: ApprovalStatus,
|
|
15000
15050
|
deliveryStatus: ApprovalDeliveryStatus,
|
|
15001
15051
|
/** Why delivery became impossible; null while pending or after delivery. */
|
|
@@ -15032,7 +15082,8 @@ var ApprovalProjection = external_exports.discriminatedUnion("metadataRedacted",
|
|
|
15032
15082
|
var ListApprovalsResponse = external_exports.object({ approvals: external_exports.array(ApprovalProjection) });
|
|
15033
15083
|
var DecideApprovalRequest = external_exports.object({
|
|
15034
15084
|
decision: external_exports.enum(["approve", "deny"]),
|
|
15035
|
-
guidance: external_exports.string().max(1e4).optional()
|
|
15085
|
+
guidance: external_exports.string().max(1e4).optional(),
|
|
15086
|
+
questionnaireAnswers: QuestionnaireAnswers.optional()
|
|
15036
15087
|
});
|
|
15037
15088
|
var UpdateGuardrailsRequest = external_exports.object({ policy: GuardrailPolicy });
|
|
15038
15089
|
|
|
@@ -17993,7 +18044,9 @@ var ApprovalDecision = external_exports.object({
|
|
|
17993
18044
|
/** Echo of the host-minted correlation id from approval.request. */
|
|
17994
18045
|
requestId: external_exports.string(),
|
|
17995
18046
|
decision: external_exports.enum(["approve", "deny"]),
|
|
17996
|
-
guidance: external_exports.string().nullable()
|
|
18047
|
+
guidance: external_exports.string().nullable(),
|
|
18048
|
+
/** Exact structured response when the request carried a questionnaire. */
|
|
18049
|
+
questionnaireAnswers: QuestionnaireAnswers.optional()
|
|
17997
18050
|
});
|
|
17998
18051
|
var ResolvedConnection = external_exports.object({
|
|
17999
18052
|
connectionId: external_exports.string(),
|
|
@@ -18562,7 +18615,9 @@ var ApprovalRequest = external_exports.object({
|
|
|
18562
18615
|
/** Concrete action payload rendered verbatim on the approval card (GR-3). */
|
|
18563
18616
|
payload: external_exports.string().max(5e4),
|
|
18564
18617
|
/** Optional structured answers for agent.question; absent means free text. */
|
|
18565
|
-
questionChoices: QuestionChoices.optional()
|
|
18618
|
+
questionChoices: QuestionChoices.optional(),
|
|
18619
|
+
/** Optional submit-once questionnaire for agent.question. */
|
|
18620
|
+
questionnaire: Questionnaire.optional()
|
|
18566
18621
|
});
|
|
18567
18622
|
var JournalAppend = external_exports.object({
|
|
18568
18623
|
type: external_exports.literal("journal.append"),
|
|
@@ -18761,6 +18816,138 @@ var CLOSE_CODES = {
|
|
|
18761
18816
|
var UNSUPPORTED_PROTOCOL_CLOSE_REASON = "unsupported protocol version";
|
|
18762
18817
|
var CLOSE_REASON_MAX_BYTES = 123;
|
|
18763
18818
|
|
|
18819
|
+
// ../../packages/contracts/src/webhook-automations.ts
|
|
18820
|
+
var WebhookHeaderName = external_exports.string().min(1).max(100).regex(/^[A-Za-z0-9-]+$/, "header names may contain letters, numbers, and hyphens");
|
|
18821
|
+
var WebhookSecret = external_exports.string().min(8).max(2e3);
|
|
18822
|
+
var RotatingSecretProjection = {
|
|
18823
|
+
secretConfigured: external_exports.literal(true),
|
|
18824
|
+
previousSecretValidUntil: IsoDate.nullable()
|
|
18825
|
+
};
|
|
18826
|
+
var WebhookAuthenticationProjection = external_exports.discriminatedUnion("kind", [
|
|
18827
|
+
external_exports.object({ kind: external_exports.literal("none") }).strict(),
|
|
18828
|
+
external_exports.object({ kind: external_exports.literal("bearer"), ...RotatingSecretProjection }).strict(),
|
|
18829
|
+
external_exports.object({
|
|
18830
|
+
kind: external_exports.literal("basic"),
|
|
18831
|
+
username: external_exports.string().min(1).max(200),
|
|
18832
|
+
...RotatingSecretProjection
|
|
18833
|
+
}).strict(),
|
|
18834
|
+
external_exports.object({ kind: external_exports.literal("github"), ...RotatingSecretProjection }).strict(),
|
|
18835
|
+
external_exports.object({
|
|
18836
|
+
kind: external_exports.literal("stripe"),
|
|
18837
|
+
toleranceSeconds: external_exports.number().int().min(30).max(86400),
|
|
18838
|
+
...RotatingSecretProjection
|
|
18839
|
+
}).strict(),
|
|
18840
|
+
external_exports.object({
|
|
18841
|
+
kind: external_exports.literal("hmac"),
|
|
18842
|
+
signatureHeader: WebhookHeaderName,
|
|
18843
|
+
signaturePrefix: external_exports.string().max(40),
|
|
18844
|
+
timestampHeader: WebhookHeaderName.nullable(),
|
|
18845
|
+
deliveryIdHeader: WebhookHeaderName.nullable(),
|
|
18846
|
+
digestEncoding: external_exports.enum(["hex", "base64"]),
|
|
18847
|
+
toleranceSeconds: external_exports.number().int().min(30).max(86400),
|
|
18848
|
+
...RotatingSecretProjection
|
|
18849
|
+
}).strict()
|
|
18850
|
+
]);
|
|
18851
|
+
var WebhookAuthenticationSetup = external_exports.discriminatedUnion("kind", [
|
|
18852
|
+
external_exports.object({ kind: external_exports.literal("none"), acknowledgedRisk: external_exports.literal(true) }).strict(),
|
|
18853
|
+
external_exports.object({ kind: external_exports.literal("bearer"), token: WebhookSecret }).strict(),
|
|
18854
|
+
external_exports.object({
|
|
18855
|
+
kind: external_exports.literal("basic"),
|
|
18856
|
+
username: external_exports.string().min(1).max(200),
|
|
18857
|
+
password: external_exports.string().min(1).max(2e3)
|
|
18858
|
+
}).strict(),
|
|
18859
|
+
external_exports.object({ kind: external_exports.literal("github"), secret: WebhookSecret }).strict(),
|
|
18860
|
+
external_exports.object({
|
|
18861
|
+
kind: external_exports.literal("stripe"),
|
|
18862
|
+
secret: WebhookSecret,
|
|
18863
|
+
toleranceSeconds: external_exports.number().int().min(30).max(86400).default(300)
|
|
18864
|
+
}).strict(),
|
|
18865
|
+
external_exports.object({
|
|
18866
|
+
kind: external_exports.literal("hmac"),
|
|
18867
|
+
secret: WebhookSecret,
|
|
18868
|
+
signatureHeader: WebhookHeaderName.default("X-Webhook-Signature"),
|
|
18869
|
+
signaturePrefix: external_exports.string().max(40).default("sha256="),
|
|
18870
|
+
timestampHeader: WebhookHeaderName.nullable().default("X-Webhook-Timestamp"),
|
|
18871
|
+
deliveryIdHeader: WebhookHeaderName.nullable().default("X-Webhook-Id"),
|
|
18872
|
+
digestEncoding: external_exports.enum(["hex", "base64"]).default("hex"),
|
|
18873
|
+
toleranceSeconds: external_exports.number().int().min(30).max(86400).default(300)
|
|
18874
|
+
}).strict()
|
|
18875
|
+
]);
|
|
18876
|
+
var WebhookAutomation = external_exports.object({
|
|
18877
|
+
id: WebhookAutomationId,
|
|
18878
|
+
orgId: OrgId,
|
|
18879
|
+
name: external_exports.string().min(1).max(120),
|
|
18880
|
+
instructions: external_exports.string().min(1).max(1e5),
|
|
18881
|
+
assignedAgentId: AgentId.nullable(),
|
|
18882
|
+
enabled: external_exports.boolean(),
|
|
18883
|
+
endpointUrl: external_exports.string().url(),
|
|
18884
|
+
authentication: WebhookAuthenticationProjection,
|
|
18885
|
+
rateLimitPerMinute: external_exports.number().int().min(1).max(1e3),
|
|
18886
|
+
retentionDays: external_exports.number().int().min(1).max(90),
|
|
18887
|
+
lastDeliveryAt: IsoDate.nullable(),
|
|
18888
|
+
createdAt: IsoDate,
|
|
18889
|
+
updatedAt: IsoDate
|
|
18890
|
+
}).strict();
|
|
18891
|
+
var CreateWebhookAutomationRequest = external_exports.object({
|
|
18892
|
+
name: WebhookAutomation.shape.name,
|
|
18893
|
+
instructions: WebhookAutomation.shape.instructions,
|
|
18894
|
+
assignedAgentId: AgentId.nullable().optional(),
|
|
18895
|
+
authentication: WebhookAuthenticationSetup,
|
|
18896
|
+
rateLimitPerMinute: WebhookAutomation.shape.rateLimitPerMinute.optional(),
|
|
18897
|
+
retentionDays: WebhookAutomation.shape.retentionDays.optional()
|
|
18898
|
+
}).strict();
|
|
18899
|
+
var UpdateWebhookAutomationRequest = external_exports.object({
|
|
18900
|
+
name: WebhookAutomation.shape.name.optional(),
|
|
18901
|
+
instructions: WebhookAutomation.shape.instructions.optional(),
|
|
18902
|
+
assignedAgentId: AgentId.nullable().optional(),
|
|
18903
|
+
enabled: external_exports.boolean().optional(),
|
|
18904
|
+
rateLimitPerMinute: WebhookAutomation.shape.rateLimitPerMinute.optional(),
|
|
18905
|
+
retentionDays: WebhookAutomation.shape.retentionDays.optional()
|
|
18906
|
+
}).strict().refine((value) => Object.keys(value).length > 0, "empty update");
|
|
18907
|
+
var ListWebhookAutomationsResponse = external_exports.object({ webhooks: external_exports.array(WebhookAutomation) }).strict();
|
|
18908
|
+
var WebhookDeliveryStatus = external_exports.enum([
|
|
18909
|
+
"received",
|
|
18910
|
+
"processing",
|
|
18911
|
+
"needs_attention",
|
|
18912
|
+
"completed",
|
|
18913
|
+
"failed",
|
|
18914
|
+
"rejected"
|
|
18915
|
+
]);
|
|
18916
|
+
var WebhookDeliveryFailureCode = external_exports.enum([
|
|
18917
|
+
"authentication_failed",
|
|
18918
|
+
"payload_too_large",
|
|
18919
|
+
"rate_limited",
|
|
18920
|
+
"manager_unavailable",
|
|
18921
|
+
"processing_failed"
|
|
18922
|
+
]);
|
|
18923
|
+
var WebhookDelivery = external_exports.object({
|
|
18924
|
+
id: WebhookDeliveryId,
|
|
18925
|
+
webhookAutomationId: WebhookAutomationId,
|
|
18926
|
+
status: WebhookDeliveryStatus,
|
|
18927
|
+
externalDeliveryId: external_exports.string().max(500).nullable(),
|
|
18928
|
+
contentType: external_exports.string().max(200),
|
|
18929
|
+
byteLength: external_exports.number().int().min(0),
|
|
18930
|
+
isTest: external_exports.boolean(),
|
|
18931
|
+
replayedFromDeliveryId: WebhookDeliveryId.nullable(),
|
|
18932
|
+
failureCode: WebhookDeliveryFailureCode.nullable(),
|
|
18933
|
+
resultSummary: external_exports.string().max(4e3).nullable(),
|
|
18934
|
+
receivedAt: IsoDate,
|
|
18935
|
+
completedAt: IsoDate.nullable()
|
|
18936
|
+
}).strict();
|
|
18937
|
+
var WebhookDeliveryDetail = WebhookDelivery.extend({
|
|
18938
|
+
/** Admin-only retained body. Null for rejected deliveries and expired bodies. */
|
|
18939
|
+
payload: external_exports.string().max(1e6).nullable()
|
|
18940
|
+
}).strict();
|
|
18941
|
+
var ListWebhookDeliveriesResponse = external_exports.object({
|
|
18942
|
+
deliveries: external_exports.array(WebhookDelivery).max(100),
|
|
18943
|
+
nextCursor: external_exports.string().max(1e3).nullable()
|
|
18944
|
+
}).strict();
|
|
18945
|
+
var TestWebhookDeliveryRequest = external_exports.object({
|
|
18946
|
+
payload: external_exports.string().min(1).max(1e5),
|
|
18947
|
+
contentType: external_exports.string().min(1).max(200).default("application/json"),
|
|
18948
|
+
externalDeliveryId: external_exports.string().min(1).max(500).optional()
|
|
18949
|
+
}).strict();
|
|
18950
|
+
|
|
18764
18951
|
// ../../packages/contracts/src/manager.ts
|
|
18765
18952
|
var MANAGER_DEFAULT_MODEL = "gpt-5.6-luna";
|
|
18766
18953
|
var MANAGER_DISPLAY_NAME_MAX = 60;
|
|
@@ -18925,7 +19112,11 @@ var ConversationEventProjection = external_exports.discriminatedUnion("kind", [
|
|
|
18925
19112
|
/** Present only for a secure Credential entry card; never a value (MG-17). */
|
|
18926
19113
|
credentialRequestId: ManagerCredentialRequestId.nullable().optional(),
|
|
18927
19114
|
/** Present only for a generic API setup/invocation card; never credentials (MG-20). */
|
|
18928
|
-
apiActionId: ManagerApiActionId.nullable().optional()
|
|
19115
|
+
apiActionId: ManagerApiActionId.nullable().optional(),
|
|
19116
|
+
/** Present only for a Webhook Automation secure setup card (MG-21). */
|
|
19117
|
+
webhookActionId: ManagerWebhookActionId.nullable().optional(),
|
|
19118
|
+
/** Present only for a Manager-authored questionnaire (MG-22). */
|
|
19119
|
+
questionnaireId: ManagerQuestionnaireId.nullable().optional()
|
|
18929
19120
|
}).strict(),
|
|
18930
19121
|
/** A mirrored child-Task event: what the teammate wrote or became. */
|
|
18931
19122
|
external_exports.object({
|
|
@@ -18947,7 +19138,9 @@ var ConversationEventProjection = external_exports.discriminatedUnion("kind", [
|
|
|
18947
19138
|
* render one outcome when recovery commits those records out of order.
|
|
18948
19139
|
* Missing on legacy/non-terminal events.
|
|
18949
19140
|
*/
|
|
18950
|
-
terminalGroup: external_exports.string().min(1).max(200).nullable().optional()
|
|
19141
|
+
terminalGroup: external_exports.string().min(1).max(200).nullable().optional(),
|
|
19142
|
+
/** Present when this teammate question has a structured answer card. */
|
|
19143
|
+
approvalId: ApprovalId.nullable().optional()
|
|
18951
19144
|
}).strict(),
|
|
18952
19145
|
/** A Manager loop failure a person should see (provider outage, refusal). */
|
|
18953
19146
|
external_exports.object({
|
|
@@ -19131,6 +19324,59 @@ var ManagerApiActionResponse = external_exports.object({
|
|
|
19131
19324
|
action: ManagerApiActionProjection,
|
|
19132
19325
|
oauth: ManagerIntegrationOAuthStart.nullable()
|
|
19133
19326
|
}).strict();
|
|
19327
|
+
var ManagerWebhookActionStatus = external_exports.enum([
|
|
19328
|
+
"awaiting_entry",
|
|
19329
|
+
"completed",
|
|
19330
|
+
"cancelled",
|
|
19331
|
+
"expired",
|
|
19332
|
+
"failed"
|
|
19333
|
+
]);
|
|
19334
|
+
var ManagerWebhookActionBase = {
|
|
19335
|
+
id: ManagerWebhookActionId,
|
|
19336
|
+
conversationId: ConversationId,
|
|
19337
|
+
status: ManagerWebhookActionStatus,
|
|
19338
|
+
suggestedAuthentication: external_exports.enum(["hmac", "github", "stripe", "bearer", "basic", "none"]),
|
|
19339
|
+
outcome: external_exports.string().max(2e3).nullable(),
|
|
19340
|
+
createdAt: external_exports.string(),
|
|
19341
|
+
expiresAt: external_exports.string()
|
|
19342
|
+
};
|
|
19343
|
+
var ManagerWebhookCreateActionProjection = external_exports.object({
|
|
19344
|
+
...ManagerWebhookActionBase,
|
|
19345
|
+
kind: external_exports.literal("create"),
|
|
19346
|
+
name: external_exports.string().min(1).max(120),
|
|
19347
|
+
instructions: external_exports.string().min(1).max(1e5),
|
|
19348
|
+
assignedAgentId: AgentId.nullable(),
|
|
19349
|
+
rateLimitPerMinute: external_exports.number().int().min(1).max(1e3),
|
|
19350
|
+
retentionDays: external_exports.number().int().min(1).max(90),
|
|
19351
|
+
webhook: WebhookAutomation.nullable()
|
|
19352
|
+
}).strict();
|
|
19353
|
+
var ManagerWebhookAuthenticationActionProjection = external_exports.object({
|
|
19354
|
+
...ManagerWebhookActionBase,
|
|
19355
|
+
kind: external_exports.literal("authentication"),
|
|
19356
|
+
webhook: WebhookAutomation.nullable()
|
|
19357
|
+
}).strict();
|
|
19358
|
+
var ManagerWebhookActionProjection = external_exports.discriminatedUnion("kind", [
|
|
19359
|
+
ManagerWebhookCreateActionProjection,
|
|
19360
|
+
ManagerWebhookAuthenticationActionProjection
|
|
19361
|
+
]);
|
|
19362
|
+
var SubmitManagerWebhookActionRequest = external_exports.object({
|
|
19363
|
+
requestId: external_exports.uuid(),
|
|
19364
|
+
authentication: WebhookAuthenticationSetup
|
|
19365
|
+
}).strict();
|
|
19366
|
+
var ConversationQuestionnaireProjection = external_exports.object({
|
|
19367
|
+
id: external_exports.union([ManagerQuestionnaireId, ApprovalId]),
|
|
19368
|
+
conversationId: ConversationId,
|
|
19369
|
+
source: external_exports.enum(["manager", "teammate"]),
|
|
19370
|
+
taskId: TaskId.nullable(),
|
|
19371
|
+
agentId: AgentId.nullable(),
|
|
19372
|
+
questionnaire: Questionnaire,
|
|
19373
|
+
status: external_exports.enum(["pending", "answered", "unavailable"]),
|
|
19374
|
+
answers: QuestionnaireAnswers.nullable(),
|
|
19375
|
+
unavailableReason: external_exports.string().max(2e3).nullable(),
|
|
19376
|
+
createdAt: external_exports.string(),
|
|
19377
|
+
answeredAt: external_exports.string().nullable()
|
|
19378
|
+
}).strict();
|
|
19379
|
+
var AnswerConversationQuestionnaireRequest = external_exports.object({ answers: QuestionnaireAnswers }).strict();
|
|
19134
19380
|
var NonEmptyTaskRunnerSelection = TaskRunnerSelection.refine(
|
|
19135
19381
|
(selection) => selection.type !== void 0 || selection.model !== void 0 || selection.effort !== void 0,
|
|
19136
19382
|
"choose at least one runtime preference"
|
|
@@ -20235,138 +20481,6 @@ var HomeExperienceResponse = external_exports.discriminatedUnion("metadataRedact
|
|
|
20235
20481
|
MemberHomeExperienceResponse
|
|
20236
20482
|
]);
|
|
20237
20483
|
|
|
20238
|
-
// ../../packages/contracts/src/webhook-automations.ts
|
|
20239
|
-
var WebhookHeaderName = external_exports.string().min(1).max(100).regex(/^[A-Za-z0-9-]+$/, "header names may contain letters, numbers, and hyphens");
|
|
20240
|
-
var WebhookSecret = external_exports.string().min(8).max(2e3);
|
|
20241
|
-
var RotatingSecretProjection = {
|
|
20242
|
-
secretConfigured: external_exports.literal(true),
|
|
20243
|
-
previousSecretValidUntil: IsoDate.nullable()
|
|
20244
|
-
};
|
|
20245
|
-
var WebhookAuthenticationProjection = external_exports.discriminatedUnion("kind", [
|
|
20246
|
-
external_exports.object({ kind: external_exports.literal("none") }).strict(),
|
|
20247
|
-
external_exports.object({ kind: external_exports.literal("bearer"), ...RotatingSecretProjection }).strict(),
|
|
20248
|
-
external_exports.object({
|
|
20249
|
-
kind: external_exports.literal("basic"),
|
|
20250
|
-
username: external_exports.string().min(1).max(200),
|
|
20251
|
-
...RotatingSecretProjection
|
|
20252
|
-
}).strict(),
|
|
20253
|
-
external_exports.object({ kind: external_exports.literal("github"), ...RotatingSecretProjection }).strict(),
|
|
20254
|
-
external_exports.object({
|
|
20255
|
-
kind: external_exports.literal("stripe"),
|
|
20256
|
-
toleranceSeconds: external_exports.number().int().min(30).max(86400),
|
|
20257
|
-
...RotatingSecretProjection
|
|
20258
|
-
}).strict(),
|
|
20259
|
-
external_exports.object({
|
|
20260
|
-
kind: external_exports.literal("hmac"),
|
|
20261
|
-
signatureHeader: WebhookHeaderName,
|
|
20262
|
-
signaturePrefix: external_exports.string().max(40),
|
|
20263
|
-
timestampHeader: WebhookHeaderName.nullable(),
|
|
20264
|
-
deliveryIdHeader: WebhookHeaderName.nullable(),
|
|
20265
|
-
digestEncoding: external_exports.enum(["hex", "base64"]),
|
|
20266
|
-
toleranceSeconds: external_exports.number().int().min(30).max(86400),
|
|
20267
|
-
...RotatingSecretProjection
|
|
20268
|
-
}).strict()
|
|
20269
|
-
]);
|
|
20270
|
-
var WebhookAuthenticationSetup = external_exports.discriminatedUnion("kind", [
|
|
20271
|
-
external_exports.object({ kind: external_exports.literal("none"), acknowledgedRisk: external_exports.literal(true) }).strict(),
|
|
20272
|
-
external_exports.object({ kind: external_exports.literal("bearer"), token: WebhookSecret }).strict(),
|
|
20273
|
-
external_exports.object({
|
|
20274
|
-
kind: external_exports.literal("basic"),
|
|
20275
|
-
username: external_exports.string().min(1).max(200),
|
|
20276
|
-
password: external_exports.string().min(1).max(2e3)
|
|
20277
|
-
}).strict(),
|
|
20278
|
-
external_exports.object({ kind: external_exports.literal("github"), secret: WebhookSecret }).strict(),
|
|
20279
|
-
external_exports.object({
|
|
20280
|
-
kind: external_exports.literal("stripe"),
|
|
20281
|
-
secret: WebhookSecret,
|
|
20282
|
-
toleranceSeconds: external_exports.number().int().min(30).max(86400).default(300)
|
|
20283
|
-
}).strict(),
|
|
20284
|
-
external_exports.object({
|
|
20285
|
-
kind: external_exports.literal("hmac"),
|
|
20286
|
-
secret: WebhookSecret,
|
|
20287
|
-
signatureHeader: WebhookHeaderName.default("X-Webhook-Signature"),
|
|
20288
|
-
signaturePrefix: external_exports.string().max(40).default("sha256="),
|
|
20289
|
-
timestampHeader: WebhookHeaderName.nullable().default("X-Webhook-Timestamp"),
|
|
20290
|
-
deliveryIdHeader: WebhookHeaderName.nullable().default("X-Webhook-Id"),
|
|
20291
|
-
digestEncoding: external_exports.enum(["hex", "base64"]).default("hex"),
|
|
20292
|
-
toleranceSeconds: external_exports.number().int().min(30).max(86400).default(300)
|
|
20293
|
-
}).strict()
|
|
20294
|
-
]);
|
|
20295
|
-
var WebhookAutomation = external_exports.object({
|
|
20296
|
-
id: WebhookAutomationId,
|
|
20297
|
-
orgId: OrgId,
|
|
20298
|
-
name: external_exports.string().min(1).max(120),
|
|
20299
|
-
instructions: external_exports.string().min(1).max(1e5),
|
|
20300
|
-
assignedAgentId: AgentId.nullable(),
|
|
20301
|
-
enabled: external_exports.boolean(),
|
|
20302
|
-
endpointUrl: external_exports.string().url(),
|
|
20303
|
-
authentication: WebhookAuthenticationProjection,
|
|
20304
|
-
rateLimitPerMinute: external_exports.number().int().min(1).max(1e3),
|
|
20305
|
-
retentionDays: external_exports.number().int().min(1).max(90),
|
|
20306
|
-
lastDeliveryAt: IsoDate.nullable(),
|
|
20307
|
-
createdAt: IsoDate,
|
|
20308
|
-
updatedAt: IsoDate
|
|
20309
|
-
}).strict();
|
|
20310
|
-
var CreateWebhookAutomationRequest = external_exports.object({
|
|
20311
|
-
name: WebhookAutomation.shape.name,
|
|
20312
|
-
instructions: WebhookAutomation.shape.instructions,
|
|
20313
|
-
assignedAgentId: AgentId.nullable().optional(),
|
|
20314
|
-
authentication: WebhookAuthenticationSetup,
|
|
20315
|
-
rateLimitPerMinute: WebhookAutomation.shape.rateLimitPerMinute.optional(),
|
|
20316
|
-
retentionDays: WebhookAutomation.shape.retentionDays.optional()
|
|
20317
|
-
}).strict();
|
|
20318
|
-
var UpdateWebhookAutomationRequest = external_exports.object({
|
|
20319
|
-
name: WebhookAutomation.shape.name.optional(),
|
|
20320
|
-
instructions: WebhookAutomation.shape.instructions.optional(),
|
|
20321
|
-
assignedAgentId: AgentId.nullable().optional(),
|
|
20322
|
-
enabled: external_exports.boolean().optional(),
|
|
20323
|
-
rateLimitPerMinute: WebhookAutomation.shape.rateLimitPerMinute.optional(),
|
|
20324
|
-
retentionDays: WebhookAutomation.shape.retentionDays.optional()
|
|
20325
|
-
}).strict().refine((value) => Object.keys(value).length > 0, "empty update");
|
|
20326
|
-
var ListWebhookAutomationsResponse = external_exports.object({ webhooks: external_exports.array(WebhookAutomation) }).strict();
|
|
20327
|
-
var WebhookDeliveryStatus = external_exports.enum([
|
|
20328
|
-
"received",
|
|
20329
|
-
"processing",
|
|
20330
|
-
"needs_attention",
|
|
20331
|
-
"completed",
|
|
20332
|
-
"failed",
|
|
20333
|
-
"rejected"
|
|
20334
|
-
]);
|
|
20335
|
-
var WebhookDeliveryFailureCode = external_exports.enum([
|
|
20336
|
-
"authentication_failed",
|
|
20337
|
-
"payload_too_large",
|
|
20338
|
-
"rate_limited",
|
|
20339
|
-
"manager_unavailable",
|
|
20340
|
-
"processing_failed"
|
|
20341
|
-
]);
|
|
20342
|
-
var WebhookDelivery = external_exports.object({
|
|
20343
|
-
id: WebhookDeliveryId,
|
|
20344
|
-
webhookAutomationId: WebhookAutomationId,
|
|
20345
|
-
status: WebhookDeliveryStatus,
|
|
20346
|
-
externalDeliveryId: external_exports.string().max(500).nullable(),
|
|
20347
|
-
contentType: external_exports.string().max(200),
|
|
20348
|
-
byteLength: external_exports.number().int().min(0),
|
|
20349
|
-
isTest: external_exports.boolean(),
|
|
20350
|
-
replayedFromDeliveryId: WebhookDeliveryId.nullable(),
|
|
20351
|
-
failureCode: WebhookDeliveryFailureCode.nullable(),
|
|
20352
|
-
resultSummary: external_exports.string().max(4e3).nullable(),
|
|
20353
|
-
receivedAt: IsoDate,
|
|
20354
|
-
completedAt: IsoDate.nullable()
|
|
20355
|
-
}).strict();
|
|
20356
|
-
var WebhookDeliveryDetail = WebhookDelivery.extend({
|
|
20357
|
-
/** Admin-only retained body. Null for rejected deliveries and expired bodies. */
|
|
20358
|
-
payload: external_exports.string().max(1e6).nullable()
|
|
20359
|
-
}).strict();
|
|
20360
|
-
var ListWebhookDeliveriesResponse = external_exports.object({
|
|
20361
|
-
deliveries: external_exports.array(WebhookDelivery).max(100),
|
|
20362
|
-
nextCursor: external_exports.string().max(1e3).nullable()
|
|
20363
|
-
}).strict();
|
|
20364
|
-
var TestWebhookDeliveryRequest = external_exports.object({
|
|
20365
|
-
payload: external_exports.string().min(1).max(1e5),
|
|
20366
|
-
contentType: external_exports.string().min(1).max(200).default("application/json"),
|
|
20367
|
-
externalDeliveryId: external_exports.string().min(1).max(500).optional()
|
|
20368
|
-
}).strict();
|
|
20369
|
-
|
|
20370
20484
|
// ../../packages/contracts/src/linear.ts
|
|
20371
20485
|
function canonicalLinearMutationPayload(value) {
|
|
20372
20486
|
if (value === null || typeof value !== "object") {
|
|
@@ -23869,7 +23983,7 @@ var HostClient = class _HostClient {
|
|
|
23869
23983
|
const { provider: _provider, ...legacyGrant } = grant;
|
|
23870
23984
|
return legacyGrant;
|
|
23871
23985
|
};
|
|
23872
|
-
const requestApproval = (category, summary, payload, questionChoices) => {
|
|
23986
|
+
const requestApproval = (category, summary, payload, questionChoices, questionnaire) => {
|
|
23873
23987
|
if (authorityController.signal.aborted) {
|
|
23874
23988
|
return Promise.resolve({ approved: false, guidance: "task was cancelled" });
|
|
23875
23989
|
}
|
|
@@ -23882,7 +23996,8 @@ var HostClient = class _HostClient {
|
|
|
23882
23996
|
category: safe(category, 200),
|
|
23883
23997
|
summary: safe(summary, 500),
|
|
23884
23998
|
payload: safe(payload, 5e4),
|
|
23885
|
-
...questionChoices ? { questionChoices: [...questionChoices] } : {}
|
|
23999
|
+
...questionChoices ? { questionChoices: [...questionChoices] } : {},
|
|
24000
|
+
...questionnaire ? { questionnaire } : {}
|
|
23886
24001
|
});
|
|
23887
24002
|
return new Promise((resolve18) => {
|
|
23888
24003
|
const waiters = this.approvalWaiters.get(cancelKey) ?? /* @__PURE__ */ new Map();
|
|
@@ -35938,7 +36053,7 @@ var CADENCE_PROPS = {
|
|
|
35938
36053
|
var TOOLS = [
|
|
35939
36054
|
{
|
|
35940
36055
|
name: "ask_user",
|
|
35941
|
-
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.
|
|
36056
|
+
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.",
|
|
35942
36057
|
inputSchema: {
|
|
35943
36058
|
type: "object",
|
|
35944
36059
|
properties: {
|
|
@@ -35966,14 +36081,63 @@ var TOOLS = [
|
|
|
35966
36081
|
minLength: 1,
|
|
35967
36082
|
maxLength: 500,
|
|
35968
36083
|
description: "Optional consequence or detail that helps the person choose."
|
|
36084
|
+
},
|
|
36085
|
+
recommended: {
|
|
36086
|
+
type: "boolean",
|
|
36087
|
+
description: "True for the one choice you recommend; omit for all others."
|
|
35969
36088
|
}
|
|
35970
36089
|
},
|
|
35971
36090
|
required: ["label"],
|
|
35972
36091
|
additionalProperties: false
|
|
35973
36092
|
}
|
|
36093
|
+
},
|
|
36094
|
+
title: {
|
|
36095
|
+
type: "string",
|
|
36096
|
+
minLength: 1,
|
|
36097
|
+
maxLength: 160,
|
|
36098
|
+
description: "Optional short heading when using questions."
|
|
36099
|
+
},
|
|
36100
|
+
questions: {
|
|
36101
|
+
type: "array",
|
|
36102
|
+
minItems: 1,
|
|
36103
|
+
maxItems: 4,
|
|
36104
|
+
description: "A submit-once questionnaire. Use instead of question/context/choices when several related answers are needed.",
|
|
36105
|
+
items: {
|
|
36106
|
+
type: "object",
|
|
36107
|
+
properties: {
|
|
36108
|
+
id: {
|
|
36109
|
+
type: "string",
|
|
36110
|
+
minLength: 1,
|
|
36111
|
+
maxLength: 80,
|
|
36112
|
+
description: "A unique stable key such as deployment_target."
|
|
36113
|
+
},
|
|
36114
|
+
question: { type: "string", minLength: 1, maxLength: 500 },
|
|
36115
|
+
context: { type: "string", minLength: 1, maxLength: 2e3 },
|
|
36116
|
+
allow_multiple: {
|
|
36117
|
+
type: "boolean",
|
|
36118
|
+
description: "True when the person may select several choices."
|
|
36119
|
+
},
|
|
36120
|
+
choices: {
|
|
36121
|
+
type: "array",
|
|
36122
|
+
minItems: 2,
|
|
36123
|
+
maxItems: 5,
|
|
36124
|
+
items: {
|
|
36125
|
+
type: "object",
|
|
36126
|
+
properties: {
|
|
36127
|
+
label: { type: "string", minLength: 1, maxLength: 120 },
|
|
36128
|
+
description: { type: "string", minLength: 1, maxLength: 500 },
|
|
36129
|
+
recommended: { type: "boolean" }
|
|
36130
|
+
},
|
|
36131
|
+
required: ["label"],
|
|
36132
|
+
additionalProperties: false
|
|
36133
|
+
}
|
|
36134
|
+
}
|
|
36135
|
+
},
|
|
36136
|
+
required: ["id", "question", "allow_multiple", "choices"],
|
|
36137
|
+
additionalProperties: false
|
|
36138
|
+
}
|
|
35974
36139
|
}
|
|
35975
36140
|
},
|
|
35976
|
-
required: ["question"],
|
|
35977
36141
|
additionalProperties: false
|
|
35978
36142
|
}
|
|
35979
36143
|
},
|
|
@@ -36605,7 +36769,8 @@ function createAskUserServer() {
|
|
|
36605
36769
|
const args = rpc.params?.["arguments"] ?? {};
|
|
36606
36770
|
if (surface.platform && name === "ask_user") {
|
|
36607
36771
|
const question = typeof args["question"] === "string" ? args["question"] : "";
|
|
36608
|
-
|
|
36772
|
+
const rawQuestions = args["questions"];
|
|
36773
|
+
if (!question && !Array.isArray(rawQuestions)) {
|
|
36609
36774
|
reply(200, {
|
|
36610
36775
|
jsonrpc: "2.0",
|
|
36611
36776
|
id: rpc.id ?? null,
|
|
@@ -36624,11 +36789,37 @@ function createAskUserServer() {
|
|
|
36624
36789
|
);
|
|
36625
36790
|
return;
|
|
36626
36791
|
}
|
|
36792
|
+
const rawQuestionnaire = Array.isArray(rawQuestions) ? {
|
|
36793
|
+
...typeof args["title"] === "string" ? { title: args["title"] } : {},
|
|
36794
|
+
questions: rawQuestions.map((entry) => {
|
|
36795
|
+
const candidate = typeof entry === "object" && entry !== null ? entry : {};
|
|
36796
|
+
return {
|
|
36797
|
+
id: candidate["id"],
|
|
36798
|
+
question: candidate["question"],
|
|
36799
|
+
...candidate["context"] === void 0 ? {} : { context: candidate["context"] },
|
|
36800
|
+
allowMultiple: candidate["allow_multiple"],
|
|
36801
|
+
choices: candidate["choices"]
|
|
36802
|
+
};
|
|
36803
|
+
})
|
|
36804
|
+
} : void 0;
|
|
36805
|
+
const parsedQuestionnaire = rawQuestionnaire === void 0 ? void 0 : Questionnaire.safeParse(rawQuestionnaire);
|
|
36806
|
+
if (parsedQuestionnaire && !parsedQuestionnaire.success) {
|
|
36807
|
+
toolText(
|
|
36808
|
+
"Questions must contain 1-4 unique items, each with 2-5 unique choices and at most one recommendation.",
|
|
36809
|
+
true
|
|
36810
|
+
);
|
|
36811
|
+
return;
|
|
36812
|
+
}
|
|
36813
|
+
if (parsedQuestionnaire?.success && (question || rawChoices !== void 0)) {
|
|
36814
|
+
toolText("Use either question/choices or questions, not both.", true);
|
|
36815
|
+
return;
|
|
36816
|
+
}
|
|
36627
36817
|
toolText(
|
|
36628
36818
|
await handlers.askUser(
|
|
36629
|
-
question,
|
|
36819
|
+
question || parsedQuestionnaire?.data.title || parsedQuestionnaire?.data.questions[0].question || "A few questions",
|
|
36630
36820
|
context,
|
|
36631
|
-
parsedChoices?.success ? parsedChoices.data : void 0
|
|
36821
|
+
parsedChoices?.success ? parsedChoices.data : void 0,
|
|
36822
|
+
parsedQuestionnaire?.success ? parsedQuestionnaire.data : void 0
|
|
36632
36823
|
)
|
|
36633
36824
|
);
|
|
36634
36825
|
} catch (err) {
|
|
@@ -38442,14 +38633,15 @@ function createCliRunner(adapter, opts = {}) {
|
|
|
38442
38633
|
throw new Error("prepared provider workspace does not match the task assignment");
|
|
38443
38634
|
}
|
|
38444
38635
|
const localMcpServers = askUserServer.register(runToken, {
|
|
38445
|
-
askUser: async (question, context, choices) => {
|
|
38636
|
+
askUser: async (question, context, choices, questionnaire) => {
|
|
38446
38637
|
pendingAsks++;
|
|
38447
38638
|
try {
|
|
38448
38639
|
const decision = await task.requestApproval(
|
|
38449
38640
|
"agent.question",
|
|
38450
38641
|
question.slice(0, 500),
|
|
38451
38642
|
(context || question).slice(0, MAX_APPROVAL_PAYLOAD),
|
|
38452
|
-
choices
|
|
38643
|
+
choices,
|
|
38644
|
+
questionnaire
|
|
38453
38645
|
);
|
|
38454
38646
|
return decision.guidance ?? (decision.approved ? "Approved. Proceed." : "No. Do not proceed.");
|
|
38455
38647
|
} finally {
|