@standards/schema 1.0.0-alpha.382 → 1.0.0-alpha.385
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/{all-BgYwavNm.d.mts → all-Czr26_QP.d.ts} +1115 -1116
- package/dist/{all-DjdKldjX.d.ts → all-DIAipZSx.d.mts} +1115 -1116
- package/dist/api/index.d.mts +2986 -2923
- package/dist/api/index.d.ts +2986 -2923
- package/dist/api/index.js +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/attribute-validators-COsyRG9V.mjs +11 -0
- package/dist/attribute-validators-CQEf6iqM.js +11 -0
- package/dist/{attributes-kAhQzg8-.d.ts → attributes-BcA_reJZ.d.ts} +58 -59
- package/dist/{attributes-aTeqx6cK.d.mts → attributes-eqr1vdPP.d.mts} +58 -59
- package/dist/checkbox-C9aJ-6gq.d.ts +10 -0
- package/dist/checkbox-DfXrFM2z.d.mts +10 -0
- package/dist/config-C1CDWJf8.mjs +2 -0
- package/dist/config-DUQAd-Ur.js +2 -0
- package/dist/{core-397tQy5q.js → core-DAxRlJ5i.js} +1 -1
- package/dist/{core-BLHhNykL.mjs → core-rKI7Q9_U.mjs} +1 -1
- package/dist/{date-D007KyTI.d.ts → date-BzggmHjS.d.mts} +5 -6
- package/dist/{date-CxqDOhA0.d.mts → date-CdaoV9_L.d.ts} +5 -6
- package/dist/{exceptions-DjPVyS-Q.d.mts → exceptions-CgzBcQIl.d.mts} +70 -70
- package/dist/{exceptions-DjPVyS-Q.d.ts → exceptions-CgzBcQIl.d.ts} +70 -70
- package/dist/exceptions.d.mts +1 -1
- package/dist/exceptions.d.ts +1 -1
- package/dist/exceptions.js +1 -1
- package/dist/exceptions.mjs +1 -1
- package/dist/{index-CiTBL4gH.d.ts → index-BSYjSdhW.d.mts} +17 -18
- package/dist/{index-DLO8JpnY.d.ts → index-CCH94vyR.d.ts} +6 -7
- package/dist/{index-DPO5w-fC.d.mts → index-D1iR2xuc.d.ts} +17 -18
- package/dist/{index-D7TEaPqX.d.ts → index-DFQSFYiY.d.mts} +2863 -2790
- package/dist/{index-DwQWBzYJ.d.mts → index-DKjcsjFG.d.ts} +2863 -2790
- package/dist/{index-Bu9xF5Nq.d.ts → index-e1Oh8ngS.d.ts} +78 -78
- package/dist/{index-BmNMneu3.d.mts → index-jDwfdudj.d.mts} +78 -78
- package/dist/{index-3HZjBOpj.d.mts → index-zJz3LbXr.d.mts} +6 -7
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/number-B3u9vPtb.d.ts +10 -0
- package/dist/number-Br56q0hL.d.mts +10 -0
- package/dist/object-BF5y6bgs.mjs +4 -0
- package/dist/object-Kx-ADbIo.js +4 -0
- package/dist/{objects-B4DgFZ82.d.ts → objects-CLxyZh-U.d.ts} +66 -57
- package/dist/{objects-C9f6hFW_.d.mts → objects-DxEMaC2Z.d.mts} +66 -57
- package/dist/phone-BGJea5sr.mjs +2 -0
- package/dist/phone-DrHyIujN.js +2 -0
- package/dist/record-aggregates-Cj3p3_ce.js +2 -0
- package/dist/{record-aggregates-CzG86pUS.mjs → record-aggregates-DQXrIuGE.mjs} +1 -1
- package/dist/record-operation-7-DRRONb.mjs +2 -0
- package/dist/record-operation-Bbn-LZhq.js +2 -0
- package/dist/text-2DB_Jc_x.js +2 -0
- package/dist/text-BaxaZ5Vv.mjs +2 -0
- package/dist/text-Bvk4ila8.d.ts +10 -0
- package/dist/text-C5NnfCJg.d.mts +10 -0
- package/dist/{utils-gY3d9Dwp.js → utils-B-gGq3FS.js} +1 -1
- package/dist/{utils-B7Dlrtnx.d.ts → utils-B2bq4zLb.d.ts} +15 -16
- package/dist/{utils-DbRMK8NI.d.mts → utils-CRx-eR8T.d.mts} +15 -16
- package/dist/{utils-fXIvFFl6.mjs → utils-DaejNWxh.mjs} +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/validation/all.d.mts +4 -4
- package/dist/validation/all.d.ts +4 -4
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +4 -4
- package/dist/validation/complex/currency.d.ts +4 -4
- package/dist/validation/complex/currency.js +1 -1
- package/dist/validation/complex/currency.mjs +1 -1
- package/dist/validation/complex/location.d.mts +4 -4
- package/dist/validation/complex/location.d.ts +4 -4
- package/dist/validation/complex/location.js +1 -1
- package/dist/validation/complex/location.mjs +1 -1
- package/dist/validation/complex/phone.d.mts +4 -4
- package/dist/validation/complex/phone.d.ts +4 -4
- package/dist/validation/complex/phone.js +1 -1
- package/dist/validation/complex/phone.mjs +1 -1
- package/dist/validation/complex/relation.d.mts +6 -6
- package/dist/validation/complex/relation.d.ts +6 -6
- package/dist/validation/complex/relation.js +1 -1
- package/dist/validation/complex/relation.mjs +1 -1
- package/dist/validation/complex/richtext.d.mts +4 -4
- package/dist/validation/complex/richtext.d.ts +4 -4
- package/dist/validation/complex/richtext.js +1 -1
- package/dist/validation/complex/richtext.mjs +1 -1
- package/dist/validation/complex/select.d.mts +6 -6
- package/dist/validation/complex/select.d.ts +6 -6
- package/dist/validation/complex/select.js +1 -1
- package/dist/validation/complex/select.mjs +1 -1
- package/dist/validation/complex/user.d.mts +4 -4
- package/dist/validation/complex/user.d.ts +4 -4
- package/dist/validation/complex/user.js +1 -1
- package/dist/validation/complex/user.mjs +1 -1
- package/dist/validation/computed/formula.d.mts +4 -4
- package/dist/validation/computed/formula.d.ts +4 -4
- package/dist/validation/computed/formula.js +1 -1
- package/dist/validation/computed/formula.mjs +1 -1
- package/dist/validation/computed/rollup.d.mts +4 -4
- package/dist/validation/computed/rollup.d.ts +4 -4
- package/dist/validation/computed/rollup.js +1 -1
- package/dist/validation/computed/rollup.mjs +1 -1
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +1 -1
- package/dist/validation/core/index.d.ts +1 -1
- package/dist/validation/core/index.js +1 -1
- package/dist/validation/core/index.mjs +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +1 -1
- package/dist/validation/primitives/checkbox.d.ts +1 -1
- package/dist/validation/primitives/checkbox.js +1 -1
- package/dist/validation/primitives/checkbox.mjs +1 -1
- package/dist/validation/primitives/date.d.mts +1 -1
- package/dist/validation/primitives/date.d.ts +1 -1
- package/dist/validation/primitives/date.js +1 -1
- package/dist/validation/primitives/date.mjs +1 -1
- package/dist/validation/primitives/number.d.mts +1 -1
- package/dist/validation/primitives/number.d.ts +1 -1
- package/dist/validation/primitives/number.js +1 -1
- package/dist/validation/primitives/number.mjs +1 -1
- package/dist/validation/primitives/text.d.mts +1 -1
- package/dist/validation/primitives/text.d.ts +1 -1
- package/dist/validation/primitives/text.js +1 -1
- package/dist/validation/primitives/text.mjs +1 -1
- package/dist/view-config.schema-BOuNAZ5T.js +2 -0
- package/dist/view-config.schema-Dl5GkAzl.mjs +2 -0
- package/dist/zod-locale-D_QkXhnp.d.mts +2 -0
- package/dist/zod-locale-D_QkXhnp.d.ts +2 -0
- package/dist/zod-locale.d.mts +2 -0
- package/dist/zod-locale.d.ts +2 -0
- package/dist/zod-locale.js +2 -0
- package/dist/zod-locale.mjs +2 -0
- package/package.json +17 -3
- package/dist/attribute-validators-DRqhAt2t.mjs +0 -11
- package/dist/attribute-validators-WAoJbap5.js +0 -11
- package/dist/checkbox-BZvZOraX.d.mts +0 -11
- package/dist/checkbox-n0YV1O13.d.ts +0 -11
- package/dist/config-BIxnbUN8.mjs +0 -2
- package/dist/config-DdjlHdPg.js +0 -2
- package/dist/number-CgBxEbjI.d.mts +0 -11
- package/dist/number-DncH-WRO.d.ts +0 -11
- package/dist/object-DcgxLvip.js +0 -4
- package/dist/object-Dzl7sfq8.mjs +0 -4
- package/dist/phone-BB-tzcSr.js +0 -2
- package/dist/phone-Bca_xiOX.mjs +0 -2
- package/dist/record-aggregates-DwpIJ2Dv.js +0 -2
- package/dist/record-operation-BSXczk7v.js +0 -2
- package/dist/record-operation-C9oXHmfF.mjs +0 -2
- package/dist/text-A9AJ1wUO.js +0 -2
- package/dist/text-C8Lb-NFo.mjs +0 -2
- package/dist/text-DDoY_LcQ.d.ts +0 -11
- package/dist/text-DeUqCFp9.d.mts +0 -11
- package/dist/view-config.schema-BQ9tU_9G.js +0 -2
- package/dist/view-config.schema-BmjCQJ51.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
const e=[`fyi`,`task`,`question`,`handoff`,`system`],t=[`low`,`normal`,`high`,`urgent`],n={low:0,normal:1,high:2,urgent:3},r=[`public`,`internal`,`sensitive`],i=[`unread`,`read`,`archived`,`snoozed`],a=[`none`,`pending`,`processing`,`completed`,`dismissed`,`expired`,`failed`],o=`agent.session.waiting_human`,s=`agent.task.assigned`,c=`agent.question.requested`,l=`agent.routine_run.failed`,u=`agent.routine_run.notice`,d=`connector.connection.reauth_required`,f=`connector.connection.error`,p=`record.assigned`,m=`access.granted`,h=[o,s,c,l,u,d,f,p,m],g=[`task`,`question`,`handoff`];function isActionableNotificationKind(e){return g.includes(e)}const _=[`agents`,`connectors`,`assignment`,`sharing`],v={[o]:{kind:`question`,area:`agents`},[s]:{kind:`task`,area:null},[c]:{kind:`question`,area:null},[l]:{kind:`system`,area:`agents`},[u]:{kind:`fyi`,area:`agents`},[d]:{kind:`system`,area:`connectors`},[f]:{kind:`system`,area:`connectors`},[p]:{kind:`fyi`,area:`assignment`},[m]:{kind:`fyi`,area:`sharing`}},y=[`in_app`,`email`],b={agentSession:`agent_session`,agent:`agent`,routine:`routine`,record:`record`,page:`page`},x=100,S=[`count`,`sum`,`avg`,`min`,`max`],C=[`day`,`week`,`month`,`quarter`,`year`];export{
|
|
2
|
+
const e=[`fyi`,`task`,`question`,`handoff`,`system`],t=[`low`,`normal`,`high`,`urgent`],n={low:0,normal:1,high:2,urgent:3},r=[`public`,`internal`,`sensitive`],i=[`unread`,`read`,`archived`,`snoozed`],a=[`none`,`pending`,`processing`,`completed`,`dismissed`,`expired`,`failed`],o=`agent.session.waiting_human`,s=`agent.task.assigned`,c=`agent.question.requested`,l=`agent.routine_run.failed`,u=`agent.routine_run.notice`,d=`connector.connection.reauth_required`,f=`connector.connection.error`,p=`record.assigned`,m=`access.granted`,h=[o,s,c,l,u,d,f,p,m],g=[`task`,`question`,`handoff`];function isActionableNotificationKind(e){return g.includes(e)}const _=[`agents`,`connectors`,`assignment`,`sharing`],v={[o]:{kind:`question`,area:`agents`},[s]:{kind:`task`,area:null},[c]:{kind:`question`,area:null},[l]:{kind:`system`,area:`agents`},[u]:{kind:`fyi`,area:`agents`},[d]:{kind:`system`,area:`connectors`},[f]:{kind:`system`,area:`connectors`},[p]:{kind:`fyi`,area:`assignment`},[m]:{kind:`fyi`,area:`sharing`}},y=[`in_app`,`email`],b={agentSession:`agent_session`,agent:`agent`,routine:`routine`,record:`record`,page:`page`},x=100,S=[`count`,`sum`,`avg`,`min`,`max`],C=[`day`,`week`,`month`,`quarter`,`year`];export{g as ACTIONABLE_NOTIFICATION_KINDS,C as AGGREGATE_BUCKETS,S as AGGREGATE_MEASURES,x as MAX_AGGREGATE_GROUPS,y as NOTIFICATION_CHANNELS,i as NOTIFICATION_INBOX_STATES,e as NOTIFICATION_KINDS,t as NOTIFICATION_PRIORITIES,n as NOTIFICATION_PRIORITY_RANK,r as NOTIFICATION_SENSITIVITIES,_ as NOTIFICATION_SETTINGS_AREAS,b as NOTIFICATION_SUBJECT_TYPES,h as NOTIFICATION_TYPES_V1,m as NOTIFICATION_TYPE_ACCESS_GRANTED,c as NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED,l as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED,u as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE,o as NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN,s as NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED,f as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR,d as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED,v as NOTIFICATION_TYPE_KINDS,p as NOTIFICATION_TYPE_RECORD_ASSIGNED,a as NOTIFICATION_WORK_STATES,isActionableNotificationKind};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import{SchemaError as e,SchemaErrorCode as t,ToolGroupGrantError as n,ValidationError as r}from"./exceptions.mjs";import"./zod-locale.mjs";import{assertUniqueBy as i,colorIdSchema as ee,iconNameSchema as te}from"./attribute-validators-COsyRG9V.mjs";import*as a from"zod";import{AVATAR_COLOR_IDS as ne}from"@standards/constants";const re=[`completed`,`failed`,`cancelled`];function invalidSessionState(n){throw new e(n,t.INVARIANT_VIOLATION)}function assertSessionState(e){e.phase===`running`?e.runningTurnId===void 0&&invalidSessionState(`running session without runningTurnId`):e.runningTurnId!==void 0&&invalidSessionState(`runningTurnId present on a ${e.phase} session`),e.phase===`parked`?e.parkedOn===void 0&&invalidSessionState(`parked session without parkedOn`):e.parkedOn!==void 0&&invalidSessionState(`parkedOn present on a ${e.phase} session`),e.parkedOn===`human`?e.humanRequestIds===void 0&&invalidSessionState(`human-parked session without humanRequestIds`):e.humanRequestIds!==void 0&&invalidSessionState(`humanRequestIds present on a session not parked on a human`)}const ie=[`createdAt`,`lastActivity`],o=Object.freeze({mutation:`ask`,destructive:`ask`,outward:`ask`}),ae=[`active`,`completed`,`abandoned`],s=[`openai`,`anthropic`,`google`,`spacexai`,`deepseek`,`moonshotai`,`alibaba`,`mistral`,`minimax`,`meta`,`zai`,`cursor`],c=[`standard`,`fast`],l=[`none`,`minimal`,`low`,`medium`,`high`,`xhigh`],u=[`conversation`,`writing`,`coding`,`analysis`,`extraction`],d=[`light`,`standard`,`heavy`],oe=[`manual`,`auto`],se={interactive:{inputPerMillionUsd:5,outputPerMillionUsd:25},delegated:{inputPerMillionUsd:2,outputPerMillionUsd:12}},f=[`model`,`speed`,`reasoning`,`imageModel`,`routing`];function mergeSessionInferencePatch(e,t){let n={...e};for(let e of f){let r=t[e];r===null?delete n[e]:r!==void 0&&Object.assign(n,{[e]:r})}return t.model&&t.routing===void 0&&(n.routing=`manual`),n}function isRoutineActorMetadata(e){return e?.kind===`routine`}const p=[`octopus`,`clover`,`flower`,`triangle`,`square`,`blob`,`circle`,`drop`,`hexagon`,`pill`,`pebble`,`puddle`],ce=[`relaxed`,`neutral`],le=4,ue=200;function agentDisplayName(e){return e.label?.trim()||e.name}const m=[`approval-requested`,`approval-responded`,`approval-dispatched`],de=[`streaming`,`running`,`pending`,...m];function isOpenToolPartState(e){return de.includes(e)}function isToolApprovalState(e){return m.includes(e)}const h=[`CREDITS_EXHAUSTED`];function isSystemPartCode(e){return typeof e==`string`&&h.includes(e)}const fe=20,pe=4e3,me=32e3;function compareAgentSessionMessages(e,t){let n=e.createdAt.getTime()-t.createdAt.getTime();return n===0?e.id.localeCompare(t.id):n}function orderAgentSessionMessages(e){return[...e].sort(compareAgentSessionMessages)}const he=200,ge=182,_e=366,ve=`agent-notification`;function isAgentNotificationMetadata(e){return e?.kind===ve}const ye=`agent-message`;function isAgentMessageMetadata(e){return e?.kind===ye}const be=[`pending`,`in_progress`,`completed`,`blocked`],xe=50,Se=80,Ce=500,g=[`sandbox`,`web`,`image`,`memory`,`bulk`,`activity`,`orchestration`,`host`,`cloud-browser`,`notifications`],we=`browser_launch`,_=[`mcp`,`email.read`,`calendar.read`,`github`,`slack.read`,`slack.write`,`device`,`browser`,`browser-profile`],Te=[`definition`,`default`,`child`,`inline`],Ee=[`manual`,`name-asc`,`name-desc`,`date-desc`,`date-asc`],De=100,Oe=500,ke=2048,v=[`reader`,`runner`,`editor`],y=[`reader`,`editor`],Ae=[`manual`,`meeting_attendee`],je=new Set([`memory`,`skill`]);function parseRole(e,t){if(typeof t==`string`&&e.includes(t))return t;let n=`role must be one of: ${e.join(`, `)}`;throw new r(n,[{path:[`role`],message:n}])}function parseRecordAccessRole(e){return parseRole(y,e)}function parseAgentDefinitionAccessRole(e){return parseRole(v,e)}function parsePageAccessRole(e){return parseRole(y,e)}function deriveViewerAccess(e,t){return e.visibility===`workspace`?`workspace`:e.ownedBy!==null&&t.includes(e.ownedBy)?`owner`:e.viewerGrant===`editor`?`editor`:e.viewerGrant===`runner`?`runner`:`reader`}const Me=[`record`,`object`,`attribute`,`view`,`user`,`role`,`settings`,`file`,`agent`,`schema_source`,`tenant_invitation`,`api_key`],Ne=`record.created,record.updated,record.deleted,record.restored,record.purged,record.access_changed,agent.access_changed,object.created,object.updated,object.deleted,attribute.created,attribute.updated,attribute.deleted,view.created,view.updated,view.deleted,schema_source.applied,schema_source.presented,schema_source.removed,user.created,user.invited,user.updated,user.deleted,user.login,user.logout,tenant_invitation.created,tenant_invitation.delivery_failed,tenant_invitation.resent,tenant_invitation.revoked,tenant_invitation.accepted,role.created,role.updated,role.deleted,role.assigned,role.revoked,api_key.detached,settings.updated,file.uploaded,file.updated,file.deleted`.split(`,`),Pe=`agentSessionId`;function isAgentWrittenAuditEntry(e){return e.actorType===`agent`||typeof e.metadata?.agentSessionId==`string`}const Fe=[`draft_schema`],Ie=`discard_architect_draft`,b=`request_design_review`,Le=`get_architect_draft`,x=`ask_questions`,S=`request_setup`,Re=new Set([x,b,S]),C=new Set([x,S]),w=new Set([b]),ze=4,Be=2e3,Ve=50,He=a.union([a.object({value:a.string(),label:a.string()}).strict(),a.object({values:a.array(a.string()),labels:a.array(a.string()),text:a.string().optional()}).strict(),a.object({text:a.string()}).strict()]),T=a.object({skipped:a.boolean().describe(`True if the person skipped all questions`),answers:a.record(a.string(),He).describe(`Map of question ID to the answer given, with each chosen option's value and label`)});function readAskQuestionsResult(e){let t=T.safeParse(e);return t.success?t.data:null}function humanRequestKind(e){return e.approvalId==null?C.has(e.name)?`question`:w.has(e.name)?`review`:null:`approval`}function isAwaitingHuman(e){return humanRequestKind(e)===null||e.state===`streaming`||!isOpenToolPartState(e.state)||e.result!==void 0||e.error!==void 0?!1:e.approvalId==null||e.state===`approval-requested`&&e.approved===void 0}function isBlocking(e){let t=humanRequestKind(e);return t===`review`?isOpenToolPartState(e.state):t===`approval`&&e.state===`approval-requested`&&e.approved===void 0}function humanRequestId(e){return e.approvalId??e.toolCallId}function openRequests(e,t){let n=t.blocking?isBlocking:isAwaitingHuman,r=[];for(let t of e)for(let e of t.parts??[])isToolRequestPart(e)&&n(e)&&r.push({part:e,id:humanRequestId(e),requestedAt:t.createdAt});return r}function isToolRequestPart(e){return e.type===`tool`}function isParkedOnHuman(e){return e?.phase===`parked`&&e.parkedOn===`human`}const Ue=50;function recentActivityEntryKey(e){return e.kind===`record`?JSON.stringify([`record`,e.objectName,e.recordId]):JSON.stringify([`conversation`,`sessionId`in e?e.sessionId:e.session.id])}const We=200,Ge=5242880,E=`Notetaker`,Ke=/^\d{1,9}(\.\d{1,6})?$/,qe={meetingRecordingPolicy:`none`,meetingBotDisplayName:E,memoryPersonMonthlyLimitUsd:null,memoryTenantMonthlyLimitUsd:null},Je=[`active`,`suspended`],Ye=[`architect`,`manual`,`auto`],Xe=[`panel`,`fullscreen`],Ze=50,Qe=200,$e=50,et=a.discriminatedUnion(`type`,[a.strictObject({type:a.literal(`record`),object:a.string().min(1),id:a.guid()}),a.strictObject({type:a.literal(`user`),id:a.guid()})]),tt=a.strictObject({nodes:a.array(et).min(1).max(50),limitPerNode:a.number().int().min(1).max(200).default(50)});function recordGraphNodeKey(e){return e.type===`record`?`record:${e.object}:${e.id}`:`user:${e.id}`}const nt=100,rt=64e3,D=`work`,O=`/vercel/sandbox/${D}`,k=`/workspace`;function environmentWorkdir(e){return e?O:k}const A=[{id:`claude-code`,label:`Claude Code`,provider:`anthropic`,apiKeyEnv:`ANTHROPIC_API_KEY`,models:[{id:`sonnet`,label:`Claude Sonnet`},{id:`opus`,label:`Claude Opus`},{id:`haiku`,label:`Claude Haiku`}],defaultModel:`sonnet`},{id:`codex`,label:`Codex`,provider:`openai`,apiKeyEnv:`OPENAI_API_KEY`,models:[{id:`gpt-6.1-sol`,label:`GPT-6.1 Sol`},{id:`gpt-6-luna`,label:`GPT-6 Luna`},{id:`gpt-6-astra`,label:`GPT-6 Astra`}],defaultModel:`gpt-6.1-sol`},{id:`cursor`,label:`Cursor`,provider:`cursor`,apiKeyEnv:`CURSOR_API_KEY`,models:[{id:`auto`,label:`Auto`,cliDefault:!0},{id:`composer-2.5`,label:`Composer 2.5`}],defaultModel:`auto`}],j=new Map(A.map(e=>[e.id,e]));function isEnvironmentHarnessId(e){return j.has(e)}function findEnvironmentHarness(e){return j.get(e)}function environmentHarness(n){let r=j.get(n);if(!r)throw new e(`Unknown harness "${n}"`,t.INVARIANT_VIOLATION);return r}function cliDefaultModelOf(e){return environmentHarness(e).models.find(e=>e.cliDefault)?.id}function compiledHarnessModels(e){let t=environmentHarness(e);return t.models.map(e=>({id:e.id,label:e.label,...e.id===t.defaultModel?{isDefault:!0}:{}}))}function harnessModelChoices(e,t){let{provider:n}=environmentHarness(e);return t.map(e=>({id:e.id,provider:n,label:e.label,...e.isDefault?{isDefault:!0}:{}}))}const M=[`search`,`query`,`read`,`write`,`delete`,`organize`,`copy`],N=[...M,`edit_content`],P=[...N,`ask_questions`,`compact_context`,`request_work_mode`,`write_todos`],F=[`browser_autopilot`,`browser_batch`,`browser_computer`,`browser_find`,`browser_form_input`,`browser_get_text`,`browser_javascript`,`browser_navigate`,`browser_read_page`,`browser_tabs`],it=[`record`,`document`,`file`,`skill`,`schema`,`guide`],I={memory:{kinds:[`memory`],capabilities:[],tools:[`propose_memory`]},bulk:{kinds:[],capabilities:[`bulk`],tools:[]},activity:{kinds:[],capabilities:[`activity`],tools:[]},"email.read":{kinds:[`email`,`thread`],capabilities:[`copy_email`],tools:[]},"calendar.read":{kinds:[`event`],capabilities:[`transcript`],tools:[]}},L={sandbox:{icon:`terminal`,tools:[`exec_command`,`publish_artifact`,`sandbox_validate_payload`]},web:{icon:`globe`,tools:[`read_webpage`,`web_search`]},image:{icon:`image`,tools:[`generate_image`]},memory:{icon:`book-open`,tools:I.memory.tools},bulk:{icon:`layers-two`,tools:I.bulk.tools},activity:{icon:`activity`,tools:I.activity.tools},orchestration:{icon:`git-branch`,tools:[`message_agent`,`spawn_agent`]},host:{icon:`wrench`,tools:[]},"cloud-browser":{icon:`globe`,tools:[`browser_launch`]},notifications:{icon:`bell`,tools:[`notify`]}},R={mcp:{icon:`puzzle`,tools:[]},"email.read":{icon:`envelope`,tools:I[`email.read`].tools},"calendar.read":{icon:`calendar`,tools:I[`calendar.read`].tools},github:{icon:`brand-github`,tools:[]},"slack.read":{icon:`brand-slack`,tools:[`slack_read`,`slack_find`,`slack_download_file`]},"slack.write":{icon:`brand-slack`,tools:[`slack_send`,`slack_react`,`slack_set_status`]},device:{icon:`desktop`,tools:[`exec_command`]},browser:{icon:`link`,tools:F},"browser-profile":{icon:`globe`,tools:[`browser_launch`,...F]}},at={sandbox:{kinds:[],capabilities:[],tools:L.sandbox.tools},web:{kinds:[],capabilities:[],tools:L.web.tools},image:{kinds:[],capabilities:[],tools:L.image.tools},memory:I.memory,bulk:I.bulk,activity:I.activity,orchestration:{kinds:[],capabilities:[],tools:L.orchestration.tools},host:{kinds:[],capabilities:[],tools:L.host.tools},"cloud-browser":{kinds:[],capabilities:[],tools:L[`cloud-browser`].tools},notifications:{kinds:[],capabilities:[],tools:L.notifications.tools},mcp:{kinds:[],capabilities:[],tools:R.mcp.tools},"email.read":I[`email.read`],"calendar.read":I[`calendar.read`],github:{kinds:[],capabilities:[],tools:R.github.tools},"slack.read":{kinds:[],capabilities:[],tools:R[`slack.read`].tools},"slack.write":{kinds:[],capabilities:[],tools:R[`slack.write`].tools},device:{kinds:[],capabilities:[],tools:R.device.tools},browser:{kinds:[],capabilities:[],tools:R.browser.tools},"browser-profile":{kinds:[],capabilities:[],tools:R[`browser-profile`].tools}},ot={schema:[`discard_architect_draft`,`draft_schema`,`get_architect_draft`,`get_schema_history`,`request_design_review`,`search_icons`],"agent-config":[`get_agents`,`upsert_agent`],setup:[`request_setup`],internal:[`load_toolset`]},st=[...new Set([...P,...g.flatMap(e=>L[e].tools),..._.flatMap(e=>R[e].tools)])],ct={"email.read":[`gmail`,`outlook`],"calendar.read":[`google-calendar`,`outlook-calendar`]};function connectionGrantKindOf(e){return e===`google-calendar`||e===`outlook-calendar`?`calendar.read`:`email.read`}function connectionGrantKindsOf(e){switch(e){case`github`:return[`github`];case`slack`:return[`slack.read`,`slack.write`];default:return[connectionGrantKindOf(e)]}}const lt=[`activity`,`bulk`,`image`,`memory`,`orchestration`,`sandbox`,`web`],ut=[`memory`],dt=new Set([`sandbox`,`host`,`cloud-browser`]);function needsManageWhenUnattended(e){return dt.has(e)||isResourceGrant(e)}function isNativeToolGroup(e){return g.includes(e)}function parseToolGroupGrant(e){if(isNativeToolGroup(e))return{type:`native`,group:e};let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);return r.length===0||!_.includes(n)?null:{type:`resource`,kind:n,id:r}}function grantKindOf(e){let t=parseToolGroupGrant(e);return t?.type===`resource`?t.kind:null}function isResourceGrant(e){return parseToolGroupGrant(e)?.type===`resource`}function resourceGrant(e,t){return`${e}:${t}`}function canonicalToolGroups(e){return[...new Set(e)].sort()}const ft=[{key:`direct`,icon:`message`,color:`ink`,description:`A message a person wrote to this mailbox: a conversation, a question, a request, a reply.`},{key:`transactional`,icon:`credit-card`,color:`terra`,description:`An automated message about an account or an operation: receipt, invoice, payment, order, shipping, booking, password reset, security alert.`},{key:`notifications`,icon:`bell`,color:`ochre`,description:`An automated alert from a tool or a service: activity on GitHub, Slack, a calendar, a CRM, a monitoring system.`},{key:`newsletters`,icon:`book-open`,color:`stone`,description:`Editorial content the mailbox subscribed to: newsletters, digests, articles, community updates.`},{key:`marketing`,icon:`percentage`,color:`iris`,description:`Promotion or prospecting: offers, discounts, product announcements, cold sales outreach.`}],pt={direct:{en:`Direct`,fr:`Direct`},transactional:{en:`Transactional`,fr:`Transactionnel`},notifications:{en:`Notifications`,fr:`Notifications`},newsletters:{en:`Newsletters`,fr:`Newsletters`},marketing:{en:`Marketing`,fr:`Marketing`}},mt=8,ht=24,gt=10,_t=500,vt=`tag`,yt=`stone`,bt=new Set(`gmail.com,googlemail.com,outlook.com,hotmail.com,hotmail.fr,outlook.fr,live.com,live.fr,msn.com,yahoo.com,yahoo.fr,icloud.com,me.com,mac.com,proton.me,protonmail.com,gmx.com,gmx.fr,orange.fr,wanadoo.fr,free.fr,laposte.net,sfr.fr,bbox.fr,numericable.fr,aol.com`.split(`,`)),xt=new Set(ft.map(e=>e.key)),St=new Set(Object.entries(pt).flatMap(([e,t])=>[e,t.en,t.fr].map(e=>e.toLowerCase())));function isSystemEmailCategory(e){return xt.has(e)}function isSystemEmailCategoryName(e){return St.has(e.trim().toLowerCase())}function isPublicMailDomain(e){return bt.has(e.toLowerCase())}const z={maxConcurrentRuns:3,retryPolicy:{maxRetries:3,backoffMs:1e3,backoffMultiplier:2}};var AgentBuilder=class{constructor(e){if(!e.name||e.name.trim().length===0)throw new r(`Agent name is required`,[]);this.bp={name:e.name,system:!0,visibility:`workspace`,triggers:[]}}description(e){return this.bp.description=e,this}label(e){return this.bp.label=e,this}avatar(e){return this.bp.avatar={type:e.type,color:e.color,expression:e.expression??`relaxed`},this}starters(e){return e.length===0?delete this.bp.starters:this.bp.starters=[...e],this}systemPrompt(e){return this.bp.systemPrompt=e,this}model(e,t,n){return this.bp.model={provider:e,model:t,...n},this}toolGroups(e){let r=e.find(e=>!isNativeToolGroup(e));if(r!==void 0)throw new n(t.AGENT_TOOL_GROUP_UNKNOWN,r,`Agent "${this.bp.name}": "${r}" is not a native tool group (blueprints cannot grant tenant resources)`);return this.bp.toolGroups=canonicalToolGroups(e),this}schedule(e){return this.bp.schedule={...e,enabled:e.enabled??!0},this}config(e){let t=this.bp.config??z,n=e.inference===void 0?t.inference:{...t.inference,...e.inference};return this.bp.config={...t,...e,...n===void 0?{}:{inference:n}},this}delegation(e){return Object.assign(this.bp,e),this}approval(e){return this.bp.approval={...o,...this.bp.approval,...e},this}visibility(e){return this.bp.visibility=e,this}trigger(e,t,n){return this.bp.triggers.push({name:e,eventType:t,...n,enabled:n?.enabled??!0}),this}runtime(){return this.bp.system=!1,this}build(){if(!this.bp.systemPrompt)throw new r(`Agent "${this.bp.name}": systemPrompt is required`,[]);if(!this.bp.model)throw new r(`Agent "${this.bp.name}": model is required`,[]);if(this.bp.system&&this.bp.visibility===`private`)throw new r(`Agent "${this.bp.name}": system agents must use workspace visibility`,[]);return i(this.bp.triggers,e=>e.name,e=>new r(`Agent "${this.bp.name}": duplicate trigger name "${e}"`,[])),{...this.bp,visibility:this.bp.visibility??`workspace`,toolGroups:this.bp.toolGroups??[...ut],config:this.bp.config??z,systemPrompt:this.bp.systemPrompt,model:this.bp.model}}};function agent(e){return new AgentBuilder(e)}const B={issue:{events:[`issues`],actions:[`opened`,`edited`,`closed`,`reopened`,`labeled`,`unlabeled`,`assigned`,`unassigned`,`milestoned`,`demilestoned`,`transferred`,`pinned`],conditions:[`label`,`issueLabels`,`assignees`,`milestone`,`issueType`,`text`]},pull_request:{events:[`pull_request`],actions:[`opened`,`ready_for_review`,`synchronize`,`review_requested`,`merged`,`closed`,`reopened`,`converted_to_draft`,`labeled`,`assigned`,`edited`],conditions:[`baseBranch`,`headBranch`,`draft`,`issueLabels`,`changedPaths`,`prAuthor`]},review:{events:[`pull_request_review`],actions:[`submitted`,`edited`,`dismissed`],conditions:[`reviewState`,`prAuthor`]},comment:{events:[`issue_comment`,`pull_request_review_comment`,`commit_comment`],actions:[`created`,`edited`,`deleted`],conditions:[`text`,`issueAuthor`,`prAuthor`]},push:{events:[`push`],actions:[`pushed`],conditions:[`branch`,`changedPaths`,`forced`]},ref:{events:[`create`,`delete`],actions:[`created`,`deleted`],conditions:[`refType`,`branch`,`tag`]},workflow:{events:[`workflow_run`],actions:[`requested`,`in_progress`,`completed`],conditions:[`workflowName`,`conclusion`,`branch`,`originEvent`]},check:{events:[`check_suite`,`check_run`],actions:[`completed`,`rerequested`],conditions:[`checkApp`,`checkName`,`conclusion`]},project_item:{events:[`projects_v2_item`],actions:[`created`,`edited`,`archived`,`restored`,`deleted`],conditions:[`project`,`projectField`,`from`,`to`,`itemType`]},release:{events:[`release`],actions:[`published`,`created`,`edited`,`prereleased`,`deleted`],conditions:[`prerelease`,`tag`]},discussion:{events:[`discussion`,`discussion_comment`],actions:[`created`,`commented`,`answered`,`labeled`,`closed`],conditions:[`category`,`issueLabels`,`text`]},repository:{events:[`star`,`fork`,`repository`],actions:[`starred`,`forked`,`created`,`archived`],conditions:[]}},Ct={mention:{events:[`app_mention`],conditions:[`text`]},message:{events:[`message`],conditions:[`position`,`text`,`hasFile`]},dm:{events:[`message`],conditions:[`text`,`hasFile`]},reaction:{events:[`reaction_added`],conditions:[`messageAuthor`]},member_joined:{events:[`member_joined_channel`],conditions:[]}},wt=a.object({field:a.literal(`text`),operator:a.enum([`contains`,`starts_with`]),value:a.string().min(1)}).strict();function stringCondition(e){return a.object({field:a.literal(e),value:a.string().min(1)}).strict()}function booleanCondition(e){return a.object({field:a.literal(e),value:a.boolean()}).strict()}function listCondition(e){return a.object({field:a.literal(e),operator:a.enum([`any`,`all`]).default(`any`),value:a.array(a.string().min(1)).min(1)}).strict()}const Tt=a.discriminatedUnion(`field`,[wt,stringCondition(`label`),listCondition(`issueLabels`),listCondition(`assignees`),stringCondition(`milestone`),stringCondition(`issueType`),stringCondition(`baseBranch`),stringCondition(`headBranch`),stringCondition(`branch`),booleanCondition(`draft`),stringCondition(`changedPaths`),booleanCondition(`forced`),stringCondition(`prAuthor`),stringCondition(`issueAuthor`),a.object({field:a.literal(`reviewState`),value:a.enum([`approved`,`changes_requested`,`commented`])}).strict(),stringCondition(`workflowName`),stringCondition(`checkApp`),stringCondition(`checkName`),stringCondition(`conclusion`),stringCondition(`originEvent`),stringCondition(`project`),stringCondition(`projectField`),a.object({field:a.literal(`from`),value:a.string().nullable()}).strict(),a.object({field:a.literal(`to`),value:a.string().nullable()}).strict(),a.object({field:a.literal(`itemType`),value:a.enum([`issue`,`pull_request`,`draft`])}).strict(),booleanCondition(`prerelease`),stringCondition(`tag`),a.object({field:a.literal(`refType`),value:a.enum([`branch`,`tag`])}).strict(),stringCondition(`category`)]),Et=a.discriminatedUnion(`field`,[wt,a.object({field:a.literal(`position`),value:a.enum([`top_level`,`reply`])}).strict(),booleanCondition(`hasFile`),stringCondition(`messageAuthor`)]),Dt=a.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/),Ot=a.enum([`human`,`me`,`any`]),kt=a.object({family:a.enum(Object.keys(B)),actions:a.array(a.string()).default([]),repositories:a.array(Dt).default([]),sender:a.union([Ot,a.object({logins:a.array(a.string().min(1)).min(1)}).strict()]).default(`human`),conditions:a.array(Tt).default([])}).strict().superRefine((e,t)=>{let n=B[e.family];e.actions.forEach((r,i)=>{n.actions.includes(r)||t.addIssue({code:`custom`,path:[`actions`,i],message:`Action ${r} is not supported by ${e.family}`})}),e.conditions.forEach((r,i)=>{n.conditions.includes(r.field)||t.addIssue({code:`custom`,path:[`conditions`,i,`field`],message:`Condition ${r.field} is not supported by ${e.family}`})})}).transform(e=>e),At=a.object({on:a.enum([`mention`,`message`,`dm`,`reaction`,`member_joined`]),channels:a.array(a.string().min(1)).default([]),reactions:a.array(a.string().min(1)).optional(),sender:a.union([Ot,a.object({users:a.array(a.string().min(1)).min(1)}).strict()]).default(`human`),conditions:a.array(Et).default([])}).strict().superRefine((e,t)=>{e.conditions.forEach((n,r)=>{Ct[e.on].conditions.includes(n.field)||t.addIssue({code:`custom`,path:[`conditions`,r,`field`],message:`Condition ${n.field} is not supported by ${e.on}`})}),e.reactions!==void 0&&e.on!==`reaction`&&t.addIssue({code:`custom`,path:[`reactions`],message:`reactions requires on=reaction`})}).transform(e=>e),jt=a.union([kt,At]),Mt=[`force`,`skip`],Nt=[`none`,`all`,`external_only`],Pt={override:null,status:`none`,failureReason:null,botId:null},Ft=a.object({speaker:a.string().nullable(),startsAtMs:a.number(),endsAtMs:a.number(),text:a.string()}),It=a.object({fullText:a.string(),segments:a.array(Ft),language:a.string().nullable(),startedAt:a.string().nullable(),endedAt:a.string().nullable()}),Lt={width:1280,height:720,maxBytes:13e5,mimeType:`image/jpeg`},Rt=Math.ceil(Lt.maxBytes/3)*4,zt=a.object({conferenceJoinUrl:a.string().min(1),botDisplayName:a.string().min(1),startsAt:a.string().nullable(),callbackUrl:a.url(),botImageJpeg:a.string().max(Rt).optional()}),Bt=a.object({botId:a.string().min(1)}),Vt=a.discriminatedUnion(`kind`,[a.object({kind:a.literal(`transcript-ready`),botId:a.string().min(1)}),a.object({kind:a.literal(`failure`),botId:a.string().min(1),reason:a.string()})]),Ht=100;let Ut=function(e){return e.Desktop=`desktop`,e}({});function isMailProvider(e){return e===`gmail`||e===`outlook`}const Wt=`DRAFT`;function isProviderDraft(e){return e.includes(Wt)}const Gt=[`threads`,`messages`];function isMailboxListMode(e){return Gt.includes(e)}const Kt=[`reply`,`reply_all`];function isReplyMode(e){return Kt.includes(e)}const qt=2e5,Jt=998,V=a.number().finite().nonnegative(),H=a.enum(s),U=a.enum(c),W=a.enum(l),G=a.enum(oe),K=a.object({provider:H,model:a.string().min(1)}).strict(),Yt=a.object({speed:U.optional(),reasoning:W.optional(),routing:G.optional()}).strict(),q=a.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9._-]*$/),Xt=a.object({model:K.optional(),speed:U.optional(),reasoning:W.optional(),imageModel:q.optional(),routing:G.optional()}).strict(),Zt=Xt.refine(e=>f.some(t=>e[t]!==void 0),{message:`At least one inference override is required`});function isSessionInferencePatch(e){return Object.keys(e).length>0&&Object.values(e).every(e=>e!==void 0)}const Qt=a.object({model:K.nullable().optional(),speed:U.nullable().optional(),reasoning:W.nullable().optional(),imageModel:q.nullable().optional(),routing:G.nullable().optional()}).strict().refine(isSessionInferencePatch,{message:`At least one inference override is required`}),$t=a.object({model:a.string().min(1),routing:a.object({mode:a.literal(`auto`),tasks:a.array(a.enum(u)).optional(),demand:a.enum(d).optional(),reason:a.enum([`selected`,`retained`,`fallback`]).optional(),relation:a.enum([`continue`,`modify`,`new`,`aside`,`unknown`]).optional(),anchorMessageId:a.string().min(1).optional()})}),J=a.object({label:a.string(),denied:a.boolean().optional(),deletion:a.object({target:a.string().optional(),count:V.optional(),restorableDays:V.optional()}).strict().optional(),record:a.object({objectName:a.string(),id:a.string(),label:a.string(),objectIcon:a.string().optional()}).strict().optional(),object:a.object({name:a.string(),label:a.string()}).strict().optional(),counts:a.record(a.string(),V).optional(),warnings:a.array(a.string()).optional()}).strict(),en=a.union([a.object({type:a.literal(`text`),text:a.string()}).strict(),a.object({type:a.literal(`reasoning`),text:a.string()}).strict(),a.object({type:a.literal(`system`),code:a.enum(h)}).strict(),a.object({type:a.literal(`error`),error:a.string(),errorClass:a.string().optional()}).strict(),a.object({type:a.literal(`tool`),toolCallId:a.string(),name:a.string(),args:a.record(a.string(),a.unknown()),result:a.unknown().optional(),error:a.string().optional(),errorCode:a.enum([`output_limit_reached`,`interrupted`,t.INVALID_TOOL_INPUT,`external_outcome_unknown`,`external_not_dispatched`]).optional(),state:a.enum([`streaming`,`running`,`completed`,`error`,`pending`,`approval-requested`,`approval-responded`,`approval-dispatched`]),durationMs:V.optional(),approvalId:a.string().optional(),approvalImpact:J.optional(),approved:a.boolean().optional(),approvalReason:a.string().optional(),approvalDecidedBy:a.string().optional(),approvalDecidedAt:a.string().optional(),approvalRelaxableByAuto:a.boolean().optional()}).strict(),a.object({type:a.literal(`file`),fileId:a.string(),name:a.string(),mimeType:a.string()}).strict(),a.object({type:a.literal(`compaction`),state:a.literal(`in-progress`),reason:a.enum([`preflight_threshold`,`overflow_recovery`]),estimatedTokens:V.optional(),reportedTokens:V.optional()}).strict(),a.object({type:a.literal(`compaction`),state:a.literal(`completed`),tokensBefore:V,tokensAfter:V,tokensSaved:V,strategy:a.enum([`no-op`,`summary`,`truncation`]),durationMs:V,summary:a.string().optional()}).strict(),a.object({type:a.literal(`compaction`),state:a.literal(`failed`),reason:a.string(),durationMs:V.optional()}).strict()]),tn=a.object({id:a.string(),name:a.string(),mimeType:a.string(),size:V}).strict(),nn=a.object({id:a.string(),artifactId:a.string(),revision:a.number().int().min(1),selectedText:a.string()}).strict(),rn=a.object({id:a.string(),type:a.string().transform(e=>e),entityId:a.string(),label:a.string(),objectName:a.string().optional(),startIndex:V,endIndex:V}).strict(),an=a.object({provider:H,model:a.string(),maxTokens:V.optional(),contextWindow:V.optional()}).strict(),on=a.union([a.date(),a.string().datetime({offset:!0}).transform(e=>new Date(e))]),sn=a.object({id:a.string(),sessionId:a.string(),tenantId:a.string().optional(),runId:a.string().optional(),role:a.enum([`user`,`assistant`,`system`,`tool`]),parts:a.array(en),attachments:a.array(tn).optional(),mentions:a.array(rn).optional(),quotes:a.array(nn).optional(),model:an.optional(),tokenUsage:a.object({input:V,output:V}).strict().optional(),metadata:a.record(a.string(),a.unknown()).optional(),createdAt:on}).strict(),cn=a.object({id:a.string(),description:a.string(),status:a.enum([`pending`,`in_progress`,`completed`,`blocked`]),result:a.string().optional(),updatedAt:V.optional()}).strict(),ln=a.object({id:a.string(),sessionId:a.string(),status:a.enum([`active`,`completed`,`abandoned`]),todos:a.array(cn),version:V,createdAt:a.string(),updatedAt:a.string(),completedAt:a.string().optional()}).strict(),Y={"compaction-start":a.object({reason:a.enum([`preflight_threshold`,`overflow_recovery`]),estimatedTokens:V.optional(),reportedTokens:V.optional()}).strict(),"compaction-end":a.object({tokensBefore:V,tokensAfter:V,tokensSaved:V,strategy:a.enum([`no-op`,`summary`,`truncation`]),durationMs:V,summary:a.string().optional()}).strict(),"compaction-failed":a.object({reason:a.string()}).strict(),usage:a.object({messageId:a.string().min(1).optional(),inputTokens:V,outputTokens:V,totalTokens:V,cacheReadTokens:V.optional(),cacheCreationTokens:V.optional(),contextWindow:V,residentTokens:V,utilization:a.number().finite().min(0).max(1),costUsd:V.optional()}).strict(),"message-updated":a.object({message:sn}).strict(),"approval-context":a.object({approvalId:a.string(),toolCallId:a.string(),impact:J.optional(),relaxableByAuto:a.boolean().optional()}).strict()};function isAgentUIDataName(e){return e in Y}function agentUIValidationError(e){return new r(`Invalid agent UI message chunk`,e.map(e=>({path:e.path.map(String),message:e.message,code:e.code})))}function assertCustomAgentUIMessageChunk(e){if(typeof e!=`object`||!e||typeof e.type!=`string`)throw new r(`Invalid agent UI message chunk`,[{path:[`type`],message:`Expected UI message chunk type`,code:`invalid_type`}]);let t=e.type;if(!t.startsWith(`data-`))throw new r(`Invalid agent UI message chunk`,[{path:[`type`],message:`Expected agent data chunk type`,code:`invalid_value`}]);let n=t.slice(5);if(!isAgentUIDataName(n))throw new r(`Invalid agent UI message chunk`,[{path:[`type`],message:`Unknown agent UI data type: ${n}`,code:`invalid_value`}]);let i=a.object({type:a.literal(`data-${n}`),id:a.string().optional(),data:Y[n],transient:a.boolean().optional()}).strict().safeParse(e);if(!i.success)throw agentUIValidationError(i.error.issues);return i.data}function agentDataChunk(e,t,n){return assertCustomAgentUIMessageChunk({type:`data-${e}`,...n?.id===void 0?{}:{id:n.id},data:t,...n?.transient===void 0?{}:{transient:n.transient}})}const un=a.string().trim().min(1).max(24),dn=a.string().trim().min(10).max(500),fn=a.enum([`address`,`domain`]),pn=a.object({scope:a.enum([`personal`,`workspace`]),name:un,description:dn,icon:te.default(`tag`),color:ee.default(yt)}),mn=a.object({name:un.optional(),description:dn.optional(),icon:te.optional(),color:ee.optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),{message:`Nothing to update`}),hn=a.object({moveTo:a.string().min(1).nullable().default(null)}),gn=a.object({category:a.string().min(1).optional(),important:a.boolean().optional()}).refine(e=>e.category!==void 0||e.important!==void 0,{message:`Nothing to classify`}),_n=a.object({verdict:a.object({category:a.string().min(1).nullable(),important:a.boolean(),classifiedBy:a.enum([`model`,`rule`,`manual`]).nullable()}),ruleId:a.string().uuid().nullable(),previousRule:a.object({scope:fn,match:a.string().trim().toLowerCase().min(1),category:a.string().min(1)}).nullable()}).refine(e=>e.ruleId!==null||e.previousRule===null,{message:`A previous rule needs the rule it restores`}),vn=a.object({scope:a.literal(`domain`)}),yn=a.object({scope:a.enum([`personal`,`workspace`])}),bn=a.object({type:a.enum(p),color:a.enum(ne),expression:a.enum(ce).default(`relaxed`)}).strict(),xn=a.array(a.string().trim().min(1).max(200)).max(4);function agentAvatarFromMetadata(e){let t=bn.safeParse(e);return t.success?t.data:void 0}const Sn=[`record.created`,`record.updated`,`record.deleted`,`form.submitted`,`webhook`,`github`,`slack`],Cn=new Set([`record.created`,`record.updated`,`record.deleted`]),wn=/^[A-Z_][A-Z0-9_]*$/,Tn=a.object({cron:a.string().min(9),timezone:a.string().optional(),enabled:a.boolean(),input:a.record(a.string(),a.unknown()).optional(),runFor:a.enum([`armer`,`audience`]).optional(),continueConversation:a.boolean().optional()}),En=/^[A-Za-z0-9_$-]+(\.[A-Za-z0-9_$-]+)*$/,X=a.object({name:a.string().max(120).optional(),eventType:a.enum(Sn),objectId:a.guid().optional(),watchedFields:a.array(a.string()).max(50).optional(),debounceMs:a.number().int().min(0).max(3e5).optional(),filter:a.object({combinator:a.enum([`and`,`or`]).default(`and`),rules:a.array(a.object({attribute:a.string(),operator:a.string(),value:a.unknown().optional()}))}).optional(),formDefinitionId:a.string().optional(),continuationKey:a.string().max(200).regex(En).nullable().optional(),connectionId:a.guid().optional(),match:jt.optional(),continueConversation:a.boolean().optional(),enabled:a.boolean().optional()});function refineTrigger(e){return e.refine(e=>!e.watchedFields?.length||e.eventType===`record.updated`,{message:`watchedFields requires eventType=record.updated`,path:[`watchedFields`]}).refine(e=>!(e.eventType&&Cn.has(e.eventType))||!!e.objectId,{message:`objectId is required for record.* triggers`,path:[`objectId`]}).refine(e=>!(e.continuationKey&&e.eventType)||e.eventType===`webhook`,{message:`continuationKey requires eventType=webhook`,path:[`continuationKey`]}).superRefine((e,t)=>{let n=e.eventType===`github`||e.eventType===`slack`;if(n&&!e.connectionId&&t.addIssue({code:`custom`,path:[`connectionId`],message:`connectionId is required for native connector triggers`}),n&&!e.match&&t.addIssue({code:`custom`,path:[`match`],message:`match is required for native connector triggers`}),e.match&&e.eventType&&((e.eventType===`github`?`family`in e.match:e.eventType===`slack`&&`on`in e.match)||t.addIssue({code:`custom`,path:[`match`],message:`match must belong to the trigger provider`})),e.eventType&&!n)for(let n of[`connectionId`,`continueConversation`])e[n]!==void 0&&t.addIssue({code:`custom`,path:[n],message:`${n} requires a native connector trigger`})})}const Dn=refineTrigger(X).transform(e=>({...e,...e.eventType===`github`||e.eventType===`slack`?{continueConversation:e.continueConversation??!0}:{}})),On=X.partial();function parseMergedAgentTrigger(e,t){let n=On.safeParse(t);if(!n.success)throw triggerValidationError(n.error);let r=Object.fromEntries(Object.entries(n.data).filter(([,e])=>e!==void 0)),i=Dn.safeParse({...e,...r});if(!i.success)throw triggerValidationError(i.error);return i.data}function triggerValidationError(e){return new r(`Invalid agent trigger`,e.issues.map(e=>({path:e.path.map(String),message:e.message})))}const kn=100,Z=a.uuid(),Q=a.record(a.string(),a.unknown()),An=a.strictObject({objectName:a.string(),recordId:Z,attribute:a.string(),base:a.unknown(),props:Q.optional()}),jn=a.strictObject({kind:a.literal(`record.set`),objectId:Z,recordId:Z,values:Q,base:Q.optional()}),Mn=a.strictObject({kind:a.literal(`record.create`),objectId:Z,recordId:Z,values:Q,options:a.strictObject({visibility:a.enum([`workspace`,`private`]).optional(),allowDraft:a.boolean().optional(),linkTo:An.optional()}).optional()}),Nn=a.strictObject({kind:a.literal(`record.delete`),objectId:Z,recordId:Z}),Pn=a.strictObject({kind:a.literal(`record.restore`),objectId:Z,recordId:Z}),$=a.string().min(1),Fn=a.discriminatedUnion(`command`,[a.strictObject({command:a.literal(`replace`),oldText:$,newText:a.string(),replaceAll:a.boolean().optional()}),a.strictObject({command:a.literal(`insert`),text:$,after:$.optional()})]),In=a.strictObject({kind:a.literal(`record.patch`),objectId:Z,recordId:Z,attribute:a.string(),edit:Fn}),Ln=a.discriminatedUnion(`kind`,[jn,Mn,Nn,Pn,In]),Rn=a.strictObject({opId:Z,steps:a.array(Ln).min(1).max(100)}).superRefine((e,t)=>{let n=new Set;for(let r of e.steps){if(n.has(r.recordId)){t.addIssue({code:`custom`,message:`one step per record`,path:[`steps`]});return}n.add(r.recordId)}});export{v as ACCESS_ROLES,me as AGENT_ASIDE_ANSWER_MAX_LENGTH,fe as AGENT_ASIDE_HISTORY_LIMIT,pe as AGENT_ASIDE_QUESTION_MAX_LENGTH,ce as AGENT_AVATAR_EXPRESSIONS,p as AGENT_AVATAR_TYPES,ye as AGENT_MESSAGE_KIND,ve as AGENT_NOTIFICATION_KIND,ie as AGENT_SESSION_LIST_ORDERS,Te as AGENT_SESSION_ORIGINS,le as AGENT_STARTERS_MAX,ue as AGENT_STARTER_MAX_LENGTH,u as AGENT_TASK_KINDS,st as ALL_CATALOG_TOOL_NAMES,it as ALWAYS_KINDS,w as APPROVAL_FAMILY_TOOL_NAMES,Be as ASK_QUESTIONS_ANSWER_MAX_LENGTH,Ve as ASK_QUESTIONS_ANSWER_MAX_VALUES,ze as ASK_QUESTIONS_MAX_BATCH,x as ASK_QUESTIONS_TOOL_NAME,Ne as AUDIT_ACTIONS,Pe as AUDIT_AGENT_SESSION_METADATA_KEY,Me as AUDIT_RESOURCE_TYPES,AgentBuilder,we as BROWSER_LAUNCH_TOOL_NAME,ct as CONNECTION_GRANT_PROVIDERS,En as CONTINUATION_KEY_PATTERN,Xe as CONVERSATION_SURFACES,N as CORE_RECORD_TOOL_NAMES,P as CORE_TOOL_NAMES,z as DEFAULT_AGENT_EXECUTION_CONFIG,lt as DEFAULT_AGENT_TOOL_GROUPS,o as DEFAULT_APPROVAL_POLICY,ut as DEFAULT_BLUEPRINT_TOOL_GROUPS,ge as DEFAULT_DAILY_ACTIVITY_DAYS,E as DEFAULT_MEETING_BOT_DISPLAY_NAME,qe as DEFAULT_TENANT_SETTINGS,Ie as DISCARD_ARCHITECT_DRAFT_TOOL_NAME,Ee as DOCUMENT_SORT_MODES,Fe as DRAFT_WRITE_TOOL_NAMES,yt as EMAIL_CATEGORY_DEFAULT_COLOR,vt as EMAIL_CATEGORY_DEFAULT_ICON,_t as EMAIL_CATEGORY_DESCRIPTION_MAX,gt as EMAIL_CATEGORY_DESCRIPTION_MIN,mt as EMAIL_CATEGORY_LIMIT,ht as EMAIL_CATEGORY_NAME_MAX,A as ENVIRONMENT_HARNESSES,D as ENVIRONMENT_HARNESS_SANDBOX_WORKDIR,O as ENVIRONMENT_HARNESS_WORKDIR,nt as ENVIRONMENT_NAME_MAX_CHARS,k as ENVIRONMENT_STANDARDS_WORKDIR,wn as ENV_VAR_KEY_PATTERN,We as FILE_URLS_MAX_IDS,Le as GET_ARCHITECT_DRAFT_TOOL_NAME,B as GITHUB_TRIGGER_CATALOG,at as GRANT_ENABLES,Re as HITL_TOOL_NAMES,l as INFERENCE_REASONING_OPTIONS,oe as INFERENCE_ROUTING_MODES,c as INFERENCE_SPEEDS,he as LAST_RUN_ERROR_MAX_LENGTH,Gt as MAILBOX_LIST_MODES,qt as MAIL_DRAFT_BODY_MAX_CHARS,Jt as MAIL_SUBJECT_MAX_CHARS,_e as MAX_DAILY_ACTIVITY_DAYS,xe as MAX_TODOS,Ce as MAX_TODO_DESCRIPTION_CHARS,Se as MAX_TODO_ID_CHARS,Ht as MCP_SERVER_NAME_MAX_LENGTH,Lt as MEETING_BOT_IMAGE,Rt as MEETING_BOT_IMAGE_BASE64_MAX_LENGTH,Ke as MEMORY_SPEND_LIMIT_PATTERN,Ut as McpOAuthCompletionMode,g as NATIVE_TOOL_GROUPS,L as NATIVE_TOOL_GROUP_CATALOG,Pt as NO_RECORDING,de as OPEN_TOOL_PART_STATES,kn as OPERATION_MAX_STEPS,Wt as PROVIDER_DRAFT_LABEL,s as PROVIDER_NAMES,bt as PUBLIC_MAIL_DOMAINS,C as QUESTION_FAMILY_TOOL_NAMES,Ue as RECENT_ACTIVITY_LEDGER_LIMIT,Mt as RECORDING_OVERRIDES,Nt as RECORDING_POLICIES,y as RECORD_ACCESS_ROLES,Ae as RECORD_ACCESS_SOURCES,ke as RECORD_DRIVE_CURSOR_MAX_LENGTH,De as RECORD_DRIVE_PAGE_DEFAULT_LIMIT,Oe as RECORD_DRIVE_PAGE_MAX_LIMIT,$e as RECORD_GRAPH_DEFAULT_LIMIT_PER_NODE,Qe as RECORD_GRAPH_MAX_LIMIT_PER_NODE,Ze as RECORD_GRAPH_MAX_NODES,Ge as RECORD_IMAGE_MAX_BYTES,Kt as REPLY_MODES,b as REQUEST_DESIGN_REVIEW_TOOL_NAME,S as REQUEST_SETUP_TOOL_NAME,_ as RESOURCE_GRANT_KINDS,R as RESOURCE_KIND_CATALOG,se as ROUTING_PRICE_CEILINGS,f as SESSION_INFERENCE_PATCH_KEYS,rt as SETUP_SCRIPT_MAX_CHARS,Ct as SLACK_TRIGGER_CATALOG,ot as SURFACE_TOOL_NAMES,ft as SYSTEM_EMAIL_CATEGORIES,pt as SYSTEM_EMAIL_CATEGORY_NAMES,h as SYSTEM_PART_CODES,d as TASK_DEMAND_LEVELS,ae as TODO_PLAN_STATUSES,be as TODO_STATUSES,m as TOOL_APPROVAL_STATES,Sn as TRIGGER_EVENT_TYPES,re as TURN_OUTCOMES,je as UNSHAREABLE_OBJECT_NAMES,Je as USER_STATUSES,Ye as USER_WORK_POSTURES,M as VERB_NAMES,agent,agentAvatarFromMetadata,bn as agentAvatarSchema,agentDataChunk,agentDisplayName,Yt as agentInferencePreferencesSchema,tn as agentMessageAttachmentSchema,en as agentMessagePartSchema,Tn as agentScheduleSchema,Xt as agentSessionInferenceOverridesInputSchema,Zt as agentSessionInferenceOverridesSchema,sn as agentSessionMessageSchema,xn as agentStartersSchema,X as agentTriggerBaseSchema,On as agentTriggerPatchSchema,Dn as agentTriggerSchema,agentUIValidationError,nn as artifactQuoteSchema,T as askQuestionsOutputSchema,assertCustomAgentUIMessageChunk,assertSessionState,canonicalToolGroups,_n as classificationRestoreSchema,gn as classifyEmailSchema,cliDefaultModelOf,compareAgentSessionMessages,compiledHarnessModels,connectionGrantKindOf,connectionGrantKindsOf,jt as connectorTriggerMatchSchema,Y as customDataChunkSchemas,deriveViewerAccess,on as durableDateSchema,pn as emailCategoryCreateSchema,hn as emailCategoryDeleteSchema,yn as emailCategoryScopeQuerySchema,mn as emailCategoryUpdateSchema,vn as emailRuleScopeSchema,environmentHarness,environmentWorkdir,findEnvironmentHarness,Tt as githubConditionSchema,kt as githubTriggerMatchSchema,grantKindOf,harnessModelChoices,humanRequestId,humanRequestKind,q as imageModelIdSchema,W as inferenceReasoningSchema,G as inferenceRoutingSchema,U as inferenceSpeedSchema,isAgentMessageMetadata,isAgentNotificationMetadata,isAgentUIDataName,isAgentWrittenAuditEntry,isAwaitingHuman,isBlocking,isEnvironmentHarnessId,isMailProvider,isMailboxListMode,isNativeToolGroup,isOpenToolPartState,isParkedOnHuman,isProviderDraft,isPublicMailDomain,isReplyMode,isResourceGrant,isRoutineActorMetadata,isSessionInferencePatch,isSystemEmailCategory,isSystemEmailCategoryName,isSystemPartCode,isToolApprovalState,zt as meetingBotDispatchRequestSchema,Bt as meetingBotDispatchResponseSchema,Vt as meetingBotNotificationSchema,Ft as meetingTranscriptSegmentSchema,rn as mentionReferenceSchema,mergeSessionInferencePatch,an as modelDefinitionSchema,K as modelReferenceSchema,needsManageWhenUnattended,It as normalizedMeetingTranscriptSchema,openRequests,orderAgentSessionMessages,parseAgentDefinitionAccessRole,parseMergedAgentTrigger,parsePageAccessRole,parseRecordAccessRole,parseToolGroupGrant,H as providerNameSchema,readAskQuestionsResult,recentActivityEntryKey,recordGraphNodeKey,tt as recordGraphRequestSchema,Rn as recordOperationSchema,refineTrigger,resourceGrant,$t as routedMessageInferenceSchema,Qt as sessionInferencePatchSchema,Et as slackConditionSchema,At as slackTriggerMatchSchema,cn as todoItemSchema,ln as todoPlanSchema,J as toolImpactSchema};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./exceptions.js"),t=require("./zod-locale.js"),n=require("./attribute-validators-CQEf6iqM.js");let r=require("zod");r=t.__toESM(r);let i=require("@standards/constants");const a=[`completed`,`failed`,`cancelled`];function invalidSessionState(t){throw new e.SchemaError(t,e.SchemaErrorCode.INVARIANT_VIOLATION)}function assertSessionState(e){e.phase===`running`?e.runningTurnId===void 0&&invalidSessionState(`running session without runningTurnId`):e.runningTurnId!==void 0&&invalidSessionState(`runningTurnId present on a ${e.phase} session`),e.phase===`parked`?e.parkedOn===void 0&&invalidSessionState(`parked session without parkedOn`):e.parkedOn!==void 0&&invalidSessionState(`parkedOn present on a ${e.phase} session`),e.parkedOn===`human`?e.humanRequestIds===void 0&&invalidSessionState(`human-parked session without humanRequestIds`):e.humanRequestIds!==void 0&&invalidSessionState(`humanRequestIds present on a session not parked on a human`)}const ee=[`createdAt`,`lastActivity`],te=Object.freeze({mutation:`ask`,destructive:`ask`,outward:`ask`}),ne=[`active`,`completed`,`abandoned`],o=[`openai`,`anthropic`,`google`,`spacexai`,`deepseek`,`moonshotai`,`alibaba`,`mistral`,`minimax`,`meta`,`zai`,`cursor`],s=[`standard`,`fast`],re=[`none`,`minimal`,`low`,`medium`,`high`,`xhigh`],ie=[`conversation`,`writing`,`coding`,`analysis`,`extraction`],ae=[`light`,`standard`,`heavy`],oe=[`manual`,`auto`],se={interactive:{inputPerMillionUsd:5,outputPerMillionUsd:25},delegated:{inputPerMillionUsd:2,outputPerMillionUsd:12}},c=[`model`,`speed`,`reasoning`,`imageModel`,`routing`];function mergeSessionInferencePatch(e,t){let n={...e};for(let e of c){let r=t[e];r===null?delete n[e]:r!==void 0&&Object.assign(n,{[e]:r})}return t.model&&t.routing===void 0&&(n.routing=`manual`),n}function isRoutineActorMetadata(e){return e?.kind===`routine`}const ce=[`octopus`,`clover`,`flower`,`triangle`,`square`,`blob`,`circle`,`drop`,`hexagon`,`pill`,`pebble`,`puddle`],le=[`relaxed`,`neutral`];function agentDisplayName(e){return e.label?.trim()||e.name}const l=[`approval-requested`,`approval-responded`,`approval-dispatched`],u=[`streaming`,`running`,`pending`,...l];function isOpenToolPartState(e){return u.includes(e)}function isToolApprovalState(e){return l.includes(e)}const d=[`CREDITS_EXHAUSTED`];function isSystemPartCode(e){return typeof e==`string`&&d.includes(e)}function compareAgentSessionMessages(e,t){let n=e.createdAt.getTime()-t.createdAt.getTime();return n===0?e.id.localeCompare(t.id):n}function orderAgentSessionMessages(e){return[...e].sort(compareAgentSessionMessages)}const f=`agent-notification`;function isAgentNotificationMetadata(e){return e?.kind===f}const p=`agent-message`;function isAgentMessageMetadata(e){return e?.kind===p}const ue=[`pending`,`in_progress`,`completed`,`blocked`],m=[`sandbox`,`web`,`image`,`memory`,`bulk`,`activity`,`orchestration`,`host`,`cloud-browser`,`notifications`],h=[`mcp`,`email.read`,`calendar.read`,`github`,`slack.read`,`slack.write`,`device`,`browser`,`browser-profile`],de=[`definition`,`default`,`child`,`inline`],fe=[`manual`,`name-asc`,`name-desc`,`date-desc`,`date-asc`],pe=[`reader`,`runner`,`editor`],g=[`reader`,`editor`],me=[`manual`,`meeting_attendee`],he=new Set([`memory`,`skill`]);function parseRole(t,n){if(typeof n==`string`&&t.includes(n))return n;let r=`role must be one of: ${t.join(`, `)}`;throw new e.ValidationError(r,[{path:[`role`],message:r}])}function parseRecordAccessRole(e){return parseRole(g,e)}function parseAgentDefinitionAccessRole(e){return parseRole(pe,e)}function parsePageAccessRole(e){return parseRole(g,e)}function deriveViewerAccess(e,t){return e.visibility===`workspace`?`workspace`:e.ownedBy!==null&&t.includes(e.ownedBy)?`owner`:e.viewerGrant===`editor`?`editor`:e.viewerGrant===`runner`?`runner`:`reader`}const ge=[`record`,`object`,`attribute`,`view`,`user`,`role`,`settings`,`file`,`agent`,`schema_source`,`tenant_invitation`,`api_key`],_e=`record.created,record.updated,record.deleted,record.restored,record.purged,record.access_changed,agent.access_changed,object.created,object.updated,object.deleted,attribute.created,attribute.updated,attribute.deleted,view.created,view.updated,view.deleted,schema_source.applied,schema_source.presented,schema_source.removed,user.created,user.invited,user.updated,user.deleted,user.login,user.logout,tenant_invitation.created,tenant_invitation.delivery_failed,tenant_invitation.resent,tenant_invitation.revoked,tenant_invitation.accepted,role.created,role.updated,role.deleted,role.assigned,role.revoked,api_key.detached,settings.updated,file.uploaded,file.updated,file.deleted`.split(`,`);function isAgentWrittenAuditEntry(e){return e.actorType===`agent`||typeof e.metadata?.agentSessionId==`string`}const ve=[`draft_schema`],_=`request_design_review`,v=`ask_questions`,y=`request_setup`,ye=new Set([v,_,y]),be=new Set([v,y]),xe=new Set([_]),Se=r.union([r.object({value:r.string(),label:r.string()}).strict(),r.object({values:r.array(r.string()),labels:r.array(r.string()),text:r.string().optional()}).strict(),r.object({text:r.string()}).strict()]),Ce=r.object({skipped:r.boolean().describe(`True if the person skipped all questions`),answers:r.record(r.string(),Se).describe(`Map of question ID to the answer given, with each chosen option's value and label`)});function readAskQuestionsResult(e){let t=Ce.safeParse(e);return t.success?t.data:null}function humanRequestKind(e){return e.approvalId==null?be.has(e.name)?`question`:xe.has(e.name)?`review`:null:`approval`}function isAwaitingHuman(e){return humanRequestKind(e)===null||e.state===`streaming`||!isOpenToolPartState(e.state)||e.result!==void 0||e.error!==void 0?!1:e.approvalId==null||e.state===`approval-requested`&&e.approved===void 0}function isBlocking(e){let t=humanRequestKind(e);return t===`review`?isOpenToolPartState(e.state):t===`approval`&&e.state===`approval-requested`&&e.approved===void 0}function humanRequestId(e){return e.approvalId??e.toolCallId}function openRequests(e,t){let n=t.blocking?isBlocking:isAwaitingHuman,r=[];for(let t of e)for(let e of t.parts??[])isToolRequestPart(e)&&n(e)&&r.push({part:e,id:humanRequestId(e),requestedAt:t.createdAt});return r}function isToolRequestPart(e){return e.type===`tool`}function isParkedOnHuman(e){return e?.phase===`parked`&&e.parkedOn===`human`}function recentActivityEntryKey(e){return e.kind===`record`?JSON.stringify([`record`,e.objectName,e.recordId]):JSON.stringify([`conversation`,`sessionId`in e?e.sessionId:e.session.id])}const we=`Notetaker`,Te=/^\d{1,9}(\.\d{1,6})?$/,Ee={meetingRecordingPolicy:`none`,meetingBotDisplayName:we,memoryPersonMonthlyLimitUsd:null,memoryTenantMonthlyLimitUsd:null},De=[`active`,`suspended`],Oe=[`architect`,`manual`,`auto`],ke=[`panel`,`fullscreen`],Ae=r.discriminatedUnion(`type`,[r.strictObject({type:r.literal(`record`),object:r.string().min(1),id:r.guid()}),r.strictObject({type:r.literal(`user`),id:r.guid()})]),je=r.strictObject({nodes:r.array(Ae).min(1).max(50),limitPerNode:r.number().int().min(1).max(200).default(50)});function recordGraphNodeKey(e){return e.type===`record`?`record:${e.object}:${e.id}`:`user:${e.id}`}const Me=`work`,Ne=`/vercel/sandbox/${Me}`,Pe=`/workspace`;function environmentWorkdir(e){return e?Ne:Pe}const Fe=[{id:`claude-code`,label:`Claude Code`,provider:`anthropic`,apiKeyEnv:`ANTHROPIC_API_KEY`,models:[{id:`sonnet`,label:`Claude Sonnet`},{id:`opus`,label:`Claude Opus`},{id:`haiku`,label:`Claude Haiku`}],defaultModel:`sonnet`},{id:`codex`,label:`Codex`,provider:`openai`,apiKeyEnv:`OPENAI_API_KEY`,models:[{id:`gpt-6.1-sol`,label:`GPT-6.1 Sol`},{id:`gpt-6-luna`,label:`GPT-6 Luna`},{id:`gpt-6-astra`,label:`GPT-6 Astra`}],defaultModel:`gpt-6.1-sol`},{id:`cursor`,label:`Cursor`,provider:`cursor`,apiKeyEnv:`CURSOR_API_KEY`,models:[{id:`auto`,label:`Auto`,cliDefault:!0},{id:`composer-2.5`,label:`Composer 2.5`}],defaultModel:`auto`}],b=new Map(Fe.map(e=>[e.id,e]));function isEnvironmentHarnessId(e){return b.has(e)}function findEnvironmentHarness(e){return b.get(e)}function environmentHarness(t){let n=b.get(t);if(!n)throw new e.SchemaError(`Unknown harness "${t}"`,e.SchemaErrorCode.INVARIANT_VIOLATION);return n}function cliDefaultModelOf(e){return environmentHarness(e).models.find(e=>e.cliDefault)?.id}function compiledHarnessModels(e){let t=environmentHarness(e);return t.models.map(e=>({id:e.id,label:e.label,...e.id===t.defaultModel?{isDefault:!0}:{}}))}function harnessModelChoices(e,t){let{provider:n}=environmentHarness(e);return t.map(e=>({id:e.id,provider:n,label:e.label,...e.isDefault?{isDefault:!0}:{}}))}const x=[`search`,`query`,`read`,`write`,`delete`,`organize`,`copy`],S=[...x,`edit_content`],C=[...S,`ask_questions`,`compact_context`,`request_work_mode`,`write_todos`],w=[`browser_autopilot`,`browser_batch`,`browser_computer`,`browser_find`,`browser_form_input`,`browser_get_text`,`browser_javascript`,`browser_navigate`,`browser_read_page`,`browser_tabs`],Ie=[`record`,`document`,`file`,`skill`,`schema`,`guide`],T={memory:{kinds:[`memory`],capabilities:[],tools:[`propose_memory`]},bulk:{kinds:[],capabilities:[`bulk`],tools:[]},activity:{kinds:[],capabilities:[`activity`],tools:[]},"email.read":{kinds:[`email`,`thread`],capabilities:[`copy_email`],tools:[]},"calendar.read":{kinds:[`event`],capabilities:[`transcript`],tools:[]}},E={sandbox:{icon:`terminal`,tools:[`exec_command`,`publish_artifact`,`sandbox_validate_payload`]},web:{icon:`globe`,tools:[`read_webpage`,`web_search`]},image:{icon:`image`,tools:[`generate_image`]},memory:{icon:`book-open`,tools:T.memory.tools},bulk:{icon:`layers-two`,tools:T.bulk.tools},activity:{icon:`activity`,tools:T.activity.tools},orchestration:{icon:`git-branch`,tools:[`message_agent`,`spawn_agent`]},host:{icon:`wrench`,tools:[]},"cloud-browser":{icon:`globe`,tools:[`browser_launch`]},notifications:{icon:`bell`,tools:[`notify`]}},D={mcp:{icon:`puzzle`,tools:[]},"email.read":{icon:`envelope`,tools:T[`email.read`].tools},"calendar.read":{icon:`calendar`,tools:T[`calendar.read`].tools},github:{icon:`brand-github`,tools:[]},"slack.read":{icon:`brand-slack`,tools:[`slack_read`,`slack_find`,`slack_download_file`]},"slack.write":{icon:`brand-slack`,tools:[`slack_send`,`slack_react`,`slack_set_status`]},device:{icon:`desktop`,tools:[`exec_command`]},browser:{icon:`link`,tools:w},"browser-profile":{icon:`globe`,tools:[`browser_launch`,...w]}},Le={sandbox:{kinds:[],capabilities:[],tools:E.sandbox.tools},web:{kinds:[],capabilities:[],tools:E.web.tools},image:{kinds:[],capabilities:[],tools:E.image.tools},memory:T.memory,bulk:T.bulk,activity:T.activity,orchestration:{kinds:[],capabilities:[],tools:E.orchestration.tools},host:{kinds:[],capabilities:[],tools:E.host.tools},"cloud-browser":{kinds:[],capabilities:[],tools:E[`cloud-browser`].tools},notifications:{kinds:[],capabilities:[],tools:E.notifications.tools},mcp:{kinds:[],capabilities:[],tools:D.mcp.tools},"email.read":T[`email.read`],"calendar.read":T[`calendar.read`],github:{kinds:[],capabilities:[],tools:D.github.tools},"slack.read":{kinds:[],capabilities:[],tools:D[`slack.read`].tools},"slack.write":{kinds:[],capabilities:[],tools:D[`slack.write`].tools},device:{kinds:[],capabilities:[],tools:D.device.tools},browser:{kinds:[],capabilities:[],tools:D.browser.tools},"browser-profile":{kinds:[],capabilities:[],tools:D[`browser-profile`].tools}},Re={schema:[`discard_architect_draft`,`draft_schema`,`get_architect_draft`,`get_schema_history`,`request_design_review`,`search_icons`],"agent-config":[`get_agents`,`upsert_agent`],setup:[`request_setup`],internal:[`load_toolset`]},ze=[...new Set([...C,...m.flatMap(e=>E[e].tools),...h.flatMap(e=>D[e].tools)])],Be={"email.read":[`gmail`,`outlook`],"calendar.read":[`google-calendar`,`outlook-calendar`]};function connectionGrantKindOf(e){return e===`google-calendar`||e===`outlook-calendar`?`calendar.read`:`email.read`}function connectionGrantKindsOf(e){switch(e){case`github`:return[`github`];case`slack`:return[`slack.read`,`slack.write`];default:return[connectionGrantKindOf(e)]}}const Ve=[`activity`,`bulk`,`image`,`memory`,`orchestration`,`sandbox`,`web`],O=[`memory`],He=new Set([`sandbox`,`host`,`cloud-browser`]);function needsManageWhenUnattended(e){return He.has(e)||isResourceGrant(e)}function isNativeToolGroup(e){return m.includes(e)}function parseToolGroupGrant(e){if(isNativeToolGroup(e))return{type:`native`,group:e};let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);return r.length===0||!h.includes(n)?null:{type:`resource`,kind:n,id:r}}function grantKindOf(e){let t=parseToolGroupGrant(e);return t?.type===`resource`?t.kind:null}function isResourceGrant(e){return parseToolGroupGrant(e)?.type===`resource`}function resourceGrant(e,t){return`${e}:${t}`}function canonicalToolGroups(e){return[...new Set(e)].sort()}const k=[{key:`direct`,icon:`message`,color:`ink`,description:`A message a person wrote to this mailbox: a conversation, a question, a request, a reply.`},{key:`transactional`,icon:`credit-card`,color:`terra`,description:`An automated message about an account or an operation: receipt, invoice, payment, order, shipping, booking, password reset, security alert.`},{key:`notifications`,icon:`bell`,color:`ochre`,description:`An automated alert from a tool or a service: activity on GitHub, Slack, a calendar, a CRM, a monitoring system.`},{key:`newsletters`,icon:`book-open`,color:`stone`,description:`Editorial content the mailbox subscribed to: newsletters, digests, articles, community updates.`},{key:`marketing`,icon:`percentage`,color:`iris`,description:`Promotion or prospecting: offers, discounts, product announcements, cold sales outreach.`}],A={direct:{en:`Direct`,fr:`Direct`},transactional:{en:`Transactional`,fr:`Transactionnel`},notifications:{en:`Notifications`,fr:`Notifications`},newsletters:{en:`Newsletters`,fr:`Newsletters`},marketing:{en:`Marketing`,fr:`Marketing`}},j=`stone`,M=new Set(`gmail.com,googlemail.com,outlook.com,hotmail.com,hotmail.fr,outlook.fr,live.com,live.fr,msn.com,yahoo.com,yahoo.fr,icloud.com,me.com,mac.com,proton.me,protonmail.com,gmx.com,gmx.fr,orange.fr,wanadoo.fr,free.fr,laposte.net,sfr.fr,bbox.fr,numericable.fr,aol.com`.split(`,`)),Ue=new Set(k.map(e=>e.key)),We=new Set(Object.entries(A).flatMap(([e,t])=>[e,t.en,t.fr].map(e=>e.toLowerCase())));function isSystemEmailCategory(e){return Ue.has(e)}function isSystemEmailCategoryName(e){return We.has(e.trim().toLowerCase())}function isPublicMailDomain(e){return M.has(e.toLowerCase())}const N={maxConcurrentRuns:3,retryPolicy:{maxRetries:3,backoffMs:1e3,backoffMultiplier:2}};var AgentBuilder=class{constructor(t){if(!t.name||t.name.trim().length===0)throw new e.ValidationError(`Agent name is required`,[]);this.bp={name:t.name,system:!0,visibility:`workspace`,triggers:[]}}description(e){return this.bp.description=e,this}label(e){return this.bp.label=e,this}avatar(e){return this.bp.avatar={type:e.type,color:e.color,expression:e.expression??`relaxed`},this}starters(e){return e.length===0?delete this.bp.starters:this.bp.starters=[...e],this}systemPrompt(e){return this.bp.systemPrompt=e,this}model(e,t,n){return this.bp.model={provider:e,model:t,...n},this}toolGroups(t){let n=t.find(e=>!isNativeToolGroup(e));if(n!==void 0)throw new e.ToolGroupGrantError(e.SchemaErrorCode.AGENT_TOOL_GROUP_UNKNOWN,n,`Agent "${this.bp.name}": "${n}" is not a native tool group (blueprints cannot grant tenant resources)`);return this.bp.toolGroups=canonicalToolGroups(t),this}schedule(e){return this.bp.schedule={...e,enabled:e.enabled??!0},this}config(e){let t=this.bp.config??N,n=e.inference===void 0?t.inference:{...t.inference,...e.inference};return this.bp.config={...t,...e,...n===void 0?{}:{inference:n}},this}delegation(e){return Object.assign(this.bp,e),this}approval(e){return this.bp.approval={...te,...this.bp.approval,...e},this}visibility(e){return this.bp.visibility=e,this}trigger(e,t,n){return this.bp.triggers.push({name:e,eventType:t,...n,enabled:n?.enabled??!0}),this}runtime(){return this.bp.system=!1,this}build(){if(!this.bp.systemPrompt)throw new e.ValidationError(`Agent "${this.bp.name}": systemPrompt is required`,[]);if(!this.bp.model)throw new e.ValidationError(`Agent "${this.bp.name}": model is required`,[]);if(this.bp.system&&this.bp.visibility===`private`)throw new e.ValidationError(`Agent "${this.bp.name}": system agents must use workspace visibility`,[]);return n.assertUniqueBy(this.bp.triggers,e=>e.name,t=>new e.ValidationError(`Agent "${this.bp.name}": duplicate trigger name "${t}"`,[])),{...this.bp,visibility:this.bp.visibility??`workspace`,toolGroups:this.bp.toolGroups??[...O],config:this.bp.config??N,systemPrompt:this.bp.systemPrompt,model:this.bp.model}}};function agent(e){return new AgentBuilder(e)}const P={issue:{events:[`issues`],actions:[`opened`,`edited`,`closed`,`reopened`,`labeled`,`unlabeled`,`assigned`,`unassigned`,`milestoned`,`demilestoned`,`transferred`,`pinned`],conditions:[`label`,`issueLabels`,`assignees`,`milestone`,`issueType`,`text`]},pull_request:{events:[`pull_request`],actions:[`opened`,`ready_for_review`,`synchronize`,`review_requested`,`merged`,`closed`,`reopened`,`converted_to_draft`,`labeled`,`assigned`,`edited`],conditions:[`baseBranch`,`headBranch`,`draft`,`issueLabels`,`changedPaths`,`prAuthor`]},review:{events:[`pull_request_review`],actions:[`submitted`,`edited`,`dismissed`],conditions:[`reviewState`,`prAuthor`]},comment:{events:[`issue_comment`,`pull_request_review_comment`,`commit_comment`],actions:[`created`,`edited`,`deleted`],conditions:[`text`,`issueAuthor`,`prAuthor`]},push:{events:[`push`],actions:[`pushed`],conditions:[`branch`,`changedPaths`,`forced`]},ref:{events:[`create`,`delete`],actions:[`created`,`deleted`],conditions:[`refType`,`branch`,`tag`]},workflow:{events:[`workflow_run`],actions:[`requested`,`in_progress`,`completed`],conditions:[`workflowName`,`conclusion`,`branch`,`originEvent`]},check:{events:[`check_suite`,`check_run`],actions:[`completed`,`rerequested`],conditions:[`checkApp`,`checkName`,`conclusion`]},project_item:{events:[`projects_v2_item`],actions:[`created`,`edited`,`archived`,`restored`,`deleted`],conditions:[`project`,`projectField`,`from`,`to`,`itemType`]},release:{events:[`release`],actions:[`published`,`created`,`edited`,`prereleased`,`deleted`],conditions:[`prerelease`,`tag`]},discussion:{events:[`discussion`,`discussion_comment`],actions:[`created`,`commented`,`answered`,`labeled`,`closed`],conditions:[`category`,`issueLabels`,`text`]},repository:{events:[`star`,`fork`,`repository`],actions:[`starred`,`forked`,`created`,`archived`],conditions:[]}},F={mention:{events:[`app_mention`],conditions:[`text`]},message:{events:[`message`],conditions:[`position`,`text`,`hasFile`]},dm:{events:[`message`],conditions:[`text`,`hasFile`]},reaction:{events:[`reaction_added`],conditions:[`messageAuthor`]},member_joined:{events:[`member_joined_channel`],conditions:[]}},I=r.object({field:r.literal(`text`),operator:r.enum([`contains`,`starts_with`]),value:r.string().min(1)}).strict();function stringCondition(e){return r.object({field:r.literal(e),value:r.string().min(1)}).strict()}function booleanCondition(e){return r.object({field:r.literal(e),value:r.boolean()}).strict()}function listCondition(e){return r.object({field:r.literal(e),operator:r.enum([`any`,`all`]).default(`any`),value:r.array(r.string().min(1)).min(1)}).strict()}const L=r.discriminatedUnion(`field`,[I,stringCondition(`label`),listCondition(`issueLabels`),listCondition(`assignees`),stringCondition(`milestone`),stringCondition(`issueType`),stringCondition(`baseBranch`),stringCondition(`headBranch`),stringCondition(`branch`),booleanCondition(`draft`),stringCondition(`changedPaths`),booleanCondition(`forced`),stringCondition(`prAuthor`),stringCondition(`issueAuthor`),r.object({field:r.literal(`reviewState`),value:r.enum([`approved`,`changes_requested`,`commented`])}).strict(),stringCondition(`workflowName`),stringCondition(`checkApp`),stringCondition(`checkName`),stringCondition(`conclusion`),stringCondition(`originEvent`),stringCondition(`project`),stringCondition(`projectField`),r.object({field:r.literal(`from`),value:r.string().nullable()}).strict(),r.object({field:r.literal(`to`),value:r.string().nullable()}).strict(),r.object({field:r.literal(`itemType`),value:r.enum([`issue`,`pull_request`,`draft`])}).strict(),booleanCondition(`prerelease`),stringCondition(`tag`),r.object({field:r.literal(`refType`),value:r.enum([`branch`,`tag`])}).strict(),stringCondition(`category`)]),R=r.discriminatedUnion(`field`,[I,r.object({field:r.literal(`position`),value:r.enum([`top_level`,`reply`])}).strict(),booleanCondition(`hasFile`),stringCondition(`messageAuthor`)]),Ge=r.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/),z=r.enum([`human`,`me`,`any`]),Ke=r.object({family:r.enum(Object.keys(P)),actions:r.array(r.string()).default([]),repositories:r.array(Ge).default([]),sender:r.union([z,r.object({logins:r.array(r.string().min(1)).min(1)}).strict()]).default(`human`),conditions:r.array(L).default([])}).strict().superRefine((e,t)=>{let n=P[e.family];e.actions.forEach((r,i)=>{n.actions.includes(r)||t.addIssue({code:`custom`,path:[`actions`,i],message:`Action ${r} is not supported by ${e.family}`})}),e.conditions.forEach((r,i)=>{n.conditions.includes(r.field)||t.addIssue({code:`custom`,path:[`conditions`,i,`field`],message:`Condition ${r.field} is not supported by ${e.family}`})})}).transform(e=>e),qe=r.object({on:r.enum([`mention`,`message`,`dm`,`reaction`,`member_joined`]),channels:r.array(r.string().min(1)).default([]),reactions:r.array(r.string().min(1)).optional(),sender:r.union([z,r.object({users:r.array(r.string().min(1)).min(1)}).strict()]).default(`human`),conditions:r.array(R).default([])}).strict().superRefine((e,t)=>{e.conditions.forEach((n,r)=>{F[e.on].conditions.includes(n.field)||t.addIssue({code:`custom`,path:[`conditions`,r,`field`],message:`Condition ${n.field} is not supported by ${e.on}`})}),e.reactions!==void 0&&e.on!==`reaction`&&t.addIssue({code:`custom`,path:[`reactions`],message:`reactions requires on=reaction`})}).transform(e=>e),Je=r.union([Ke,qe]),Ye=[`force`,`skip`],Xe=[`none`,`all`,`external_only`],Ze={override:null,status:`none`,failureReason:null,botId:null},Qe=r.object({speaker:r.string().nullable(),startsAtMs:r.number(),endsAtMs:r.number(),text:r.string()}),$e=r.object({fullText:r.string(),segments:r.array(Qe),language:r.string().nullable(),startedAt:r.string().nullable(),endedAt:r.string().nullable()}),et={width:1280,height:720,maxBytes:13e5,mimeType:`image/jpeg`},tt=Math.ceil(et.maxBytes/3)*4,nt=r.object({conferenceJoinUrl:r.string().min(1),botDisplayName:r.string().min(1),startsAt:r.string().nullable(),callbackUrl:r.url(),botImageJpeg:r.string().max(tt).optional()}),rt=r.object({botId:r.string().min(1)}),it=r.discriminatedUnion(`kind`,[r.object({kind:r.literal(`transcript-ready`),botId:r.string().min(1)}),r.object({kind:r.literal(`failure`),botId:r.string().min(1),reason:r.string()})]);let at=function(e){return e.Desktop=`desktop`,e}({});function isMailProvider(e){return e===`gmail`||e===`outlook`}const ot=`DRAFT`;function isProviderDraft(e){return e.includes(ot)}const st=[`threads`,`messages`];function isMailboxListMode(e){return st.includes(e)}const ct=[`reply`,`reply_all`];function isReplyMode(e){return ct.includes(e)}const B=r.number().finite().nonnegative(),V=r.enum(o),H=r.enum(s),U=r.enum(re),W=r.enum(oe),G=r.object({provider:V,model:r.string().min(1)}).strict(),lt=r.object({speed:H.optional(),reasoning:U.optional(),routing:W.optional()}).strict(),K=r.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9._-]*$/),ut=r.object({model:G.optional(),speed:H.optional(),reasoning:U.optional(),imageModel:K.optional(),routing:W.optional()}).strict(),dt=ut.refine(e=>c.some(t=>e[t]!==void 0),{message:`At least one inference override is required`});function isSessionInferencePatch(e){return Object.keys(e).length>0&&Object.values(e).every(e=>e!==void 0)}const ft=r.object({model:G.nullable().optional(),speed:H.nullable().optional(),reasoning:U.nullable().optional(),imageModel:K.nullable().optional(),routing:W.nullable().optional()}).strict().refine(isSessionInferencePatch,{message:`At least one inference override is required`}),pt=r.object({model:r.string().min(1),routing:r.object({mode:r.literal(`auto`),tasks:r.array(r.enum(ie)).optional(),demand:r.enum(ae).optional(),reason:r.enum([`selected`,`retained`,`fallback`]).optional(),relation:r.enum([`continue`,`modify`,`new`,`aside`,`unknown`]).optional(),anchorMessageId:r.string().min(1).optional()})}),q=r.object({label:r.string(),denied:r.boolean().optional(),deletion:r.object({target:r.string().optional(),count:B.optional(),restorableDays:B.optional()}).strict().optional(),record:r.object({objectName:r.string(),id:r.string(),label:r.string(),objectIcon:r.string().optional()}).strict().optional(),object:r.object({name:r.string(),label:r.string()}).strict().optional(),counts:r.record(r.string(),B).optional(),warnings:r.array(r.string()).optional()}).strict(),mt=r.union([r.object({type:r.literal(`text`),text:r.string()}).strict(),r.object({type:r.literal(`reasoning`),text:r.string()}).strict(),r.object({type:r.literal(`system`),code:r.enum(d)}).strict(),r.object({type:r.literal(`error`),error:r.string(),errorClass:r.string().optional()}).strict(),r.object({type:r.literal(`tool`),toolCallId:r.string(),name:r.string(),args:r.record(r.string(),r.unknown()),result:r.unknown().optional(),error:r.string().optional(),errorCode:r.enum([`output_limit_reached`,`interrupted`,e.SchemaErrorCode.INVALID_TOOL_INPUT,`external_outcome_unknown`,`external_not_dispatched`]).optional(),state:r.enum([`streaming`,`running`,`completed`,`error`,`pending`,`approval-requested`,`approval-responded`,`approval-dispatched`]),durationMs:B.optional(),approvalId:r.string().optional(),approvalImpact:q.optional(),approved:r.boolean().optional(),approvalReason:r.string().optional(),approvalDecidedBy:r.string().optional(),approvalDecidedAt:r.string().optional(),approvalRelaxableByAuto:r.boolean().optional()}).strict(),r.object({type:r.literal(`file`),fileId:r.string(),name:r.string(),mimeType:r.string()}).strict(),r.object({type:r.literal(`compaction`),state:r.literal(`in-progress`),reason:r.enum([`preflight_threshold`,`overflow_recovery`]),estimatedTokens:B.optional(),reportedTokens:B.optional()}).strict(),r.object({type:r.literal(`compaction`),state:r.literal(`completed`),tokensBefore:B,tokensAfter:B,tokensSaved:B,strategy:r.enum([`no-op`,`summary`,`truncation`]),durationMs:B,summary:r.string().optional()}).strict(),r.object({type:r.literal(`compaction`),state:r.literal(`failed`),reason:r.string(),durationMs:B.optional()}).strict()]),ht=r.object({id:r.string(),name:r.string(),mimeType:r.string(),size:B}).strict(),gt=r.object({id:r.string(),artifactId:r.string(),revision:r.number().int().min(1),selectedText:r.string()}).strict(),_t=r.object({id:r.string(),type:r.string().transform(e=>e),entityId:r.string(),label:r.string(),objectName:r.string().optional(),startIndex:B,endIndex:B}).strict(),vt=r.object({provider:V,model:r.string(),maxTokens:B.optional(),contextWindow:B.optional()}).strict(),yt=r.union([r.date(),r.string().datetime({offset:!0}).transform(e=>new Date(e))]),bt=r.object({id:r.string(),sessionId:r.string(),tenantId:r.string().optional(),runId:r.string().optional(),role:r.enum([`user`,`assistant`,`system`,`tool`]),parts:r.array(mt),attachments:r.array(ht).optional(),mentions:r.array(_t).optional(),quotes:r.array(gt).optional(),model:vt.optional(),tokenUsage:r.object({input:B,output:B}).strict().optional(),metadata:r.record(r.string(),r.unknown()).optional(),createdAt:yt}).strict(),xt=r.object({id:r.string(),description:r.string(),status:r.enum([`pending`,`in_progress`,`completed`,`blocked`]),result:r.string().optional(),updatedAt:B.optional()}).strict(),St=r.object({id:r.string(),sessionId:r.string(),status:r.enum([`active`,`completed`,`abandoned`]),todos:r.array(xt),version:B,createdAt:r.string(),updatedAt:r.string(),completedAt:r.string().optional()}).strict(),J={"compaction-start":r.object({reason:r.enum([`preflight_threshold`,`overflow_recovery`]),estimatedTokens:B.optional(),reportedTokens:B.optional()}).strict(),"compaction-end":r.object({tokensBefore:B,tokensAfter:B,tokensSaved:B,strategy:r.enum([`no-op`,`summary`,`truncation`]),durationMs:B,summary:r.string().optional()}).strict(),"compaction-failed":r.object({reason:r.string()}).strict(),usage:r.object({messageId:r.string().min(1).optional(),inputTokens:B,outputTokens:B,totalTokens:B,cacheReadTokens:B.optional(),cacheCreationTokens:B.optional(),contextWindow:B,residentTokens:B,utilization:r.number().finite().min(0).max(1),costUsd:B.optional()}).strict(),"message-updated":r.object({message:bt}).strict(),"approval-context":r.object({approvalId:r.string(),toolCallId:r.string(),impact:q.optional(),relaxableByAuto:r.boolean().optional()}).strict()};function isAgentUIDataName(e){return e in J}function agentUIValidationError(t){return new e.ValidationError(`Invalid agent UI message chunk`,t.map(e=>({path:e.path.map(String),message:e.message,code:e.code})))}function assertCustomAgentUIMessageChunk(t){if(typeof t!=`object`||!t||typeof t.type!=`string`)throw new e.ValidationError(`Invalid agent UI message chunk`,[{path:[`type`],message:`Expected UI message chunk type`,code:`invalid_type`}]);let n=t.type;if(!n.startsWith(`data-`))throw new e.ValidationError(`Invalid agent UI message chunk`,[{path:[`type`],message:`Expected agent data chunk type`,code:`invalid_value`}]);let i=n.slice(5);if(!isAgentUIDataName(i))throw new e.ValidationError(`Invalid agent UI message chunk`,[{path:[`type`],message:`Unknown agent UI data type: ${i}`,code:`invalid_value`}]);let a=r.object({type:r.literal(`data-${i}`),id:r.string().optional(),data:J[i],transient:r.boolean().optional()}).strict().safeParse(t);if(!a.success)throw agentUIValidationError(a.error.issues);return a.data}function agentDataChunk(e,t,n){return assertCustomAgentUIMessageChunk({type:`data-${e}`,...n?.id===void 0?{}:{id:n.id},data:t,...n?.transient===void 0?{}:{transient:n.transient}})}const Ct=r.string().trim().min(1).max(24),wt=r.string().trim().min(10).max(500),Tt=r.enum([`address`,`domain`]),Et=r.object({scope:r.enum([`personal`,`workspace`]),name:Ct,description:wt,icon:n.iconNameSchema.default(`tag`),color:n.colorIdSchema.default(j)}),Dt=r.object({name:Ct.optional(),description:wt.optional(),icon:n.iconNameSchema.optional(),color:n.colorIdSchema.optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),{message:`Nothing to update`}),Ot=r.object({moveTo:r.string().min(1).nullable().default(null)}),kt=r.object({category:r.string().min(1).optional(),important:r.boolean().optional()}).refine(e=>e.category!==void 0||e.important!==void 0,{message:`Nothing to classify`}),At=r.object({verdict:r.object({category:r.string().min(1).nullable(),important:r.boolean(),classifiedBy:r.enum([`model`,`rule`,`manual`]).nullable()}),ruleId:r.string().uuid().nullable(),previousRule:r.object({scope:Tt,match:r.string().trim().toLowerCase().min(1),category:r.string().min(1)}).nullable()}).refine(e=>e.ruleId!==null||e.previousRule===null,{message:`A previous rule needs the rule it restores`}),jt=r.object({scope:r.literal(`domain`)}),Mt=r.object({scope:r.enum([`personal`,`workspace`])}),Y=r.object({type:r.enum(ce),color:r.enum(i.AVATAR_COLOR_IDS),expression:r.enum(le).default(`relaxed`)}).strict(),Nt=r.array(r.string().trim().min(1).max(200)).max(4);function agentAvatarFromMetadata(e){let t=Y.safeParse(e);return t.success?t.data:void 0}const Pt=[`record.created`,`record.updated`,`record.deleted`,`form.submitted`,`webhook`,`github`,`slack`],Ft=new Set([`record.created`,`record.updated`,`record.deleted`]),It=/^[A-Z_][A-Z0-9_]*$/,Lt=r.object({cron:r.string().min(9),timezone:r.string().optional(),enabled:r.boolean(),input:r.record(r.string(),r.unknown()).optional(),runFor:r.enum([`armer`,`audience`]).optional(),continueConversation:r.boolean().optional()}),Rt=/^[A-Za-z0-9_$-]+(\.[A-Za-z0-9_$-]+)*$/,X=r.object({name:r.string().max(120).optional(),eventType:r.enum(Pt),objectId:r.guid().optional(),watchedFields:r.array(r.string()).max(50).optional(),debounceMs:r.number().int().min(0).max(3e5).optional(),filter:r.object({combinator:r.enum([`and`,`or`]).default(`and`),rules:r.array(r.object({attribute:r.string(),operator:r.string(),value:r.unknown().optional()}))}).optional(),formDefinitionId:r.string().optional(),continuationKey:r.string().max(200).regex(Rt).nullable().optional(),connectionId:r.guid().optional(),match:Je.optional(),continueConversation:r.boolean().optional(),enabled:r.boolean().optional()});function refineTrigger(e){return e.refine(e=>!e.watchedFields?.length||e.eventType===`record.updated`,{message:`watchedFields requires eventType=record.updated`,path:[`watchedFields`]}).refine(e=>!(e.eventType&&Ft.has(e.eventType))||!!e.objectId,{message:`objectId is required for record.* triggers`,path:[`objectId`]}).refine(e=>!(e.continuationKey&&e.eventType)||e.eventType===`webhook`,{message:`continuationKey requires eventType=webhook`,path:[`continuationKey`]}).superRefine((e,t)=>{let n=e.eventType===`github`||e.eventType===`slack`;if(n&&!e.connectionId&&t.addIssue({code:`custom`,path:[`connectionId`],message:`connectionId is required for native connector triggers`}),n&&!e.match&&t.addIssue({code:`custom`,path:[`match`],message:`match is required for native connector triggers`}),e.match&&e.eventType&&((e.eventType===`github`?`family`in e.match:e.eventType===`slack`&&`on`in e.match)||t.addIssue({code:`custom`,path:[`match`],message:`match must belong to the trigger provider`})),e.eventType&&!n)for(let n of[`connectionId`,`continueConversation`])e[n]!==void 0&&t.addIssue({code:`custom`,path:[n],message:`${n} requires a native connector trigger`})})}const zt=refineTrigger(X).transform(e=>({...e,...e.eventType===`github`||e.eventType===`slack`?{continueConversation:e.continueConversation??!0}:{}})),Bt=X.partial();function parseMergedAgentTrigger(e,t){let n=Bt.safeParse(t);if(!n.success)throw triggerValidationError(n.error);let r=Object.fromEntries(Object.entries(n.data).filter(([,e])=>e!==void 0)),i=zt.safeParse({...e,...r});if(!i.success)throw triggerValidationError(i.error);return i.data}function triggerValidationError(t){return new e.ValidationError(`Invalid agent trigger`,t.issues.map(e=>({path:e.path.map(String),message:e.message})))}const Z=r.uuid(),Q=r.record(r.string(),r.unknown()),Vt=r.strictObject({objectName:r.string(),recordId:Z,attribute:r.string(),base:r.unknown(),props:Q.optional()}),Ht=r.strictObject({kind:r.literal(`record.set`),objectId:Z,recordId:Z,values:Q,base:Q.optional()}),Ut=r.strictObject({kind:r.literal(`record.create`),objectId:Z,recordId:Z,values:Q,options:r.strictObject({visibility:r.enum([`workspace`,`private`]).optional(),allowDraft:r.boolean().optional(),linkTo:Vt.optional()}).optional()}),Wt=r.strictObject({kind:r.literal(`record.delete`),objectId:Z,recordId:Z}),Gt=r.strictObject({kind:r.literal(`record.restore`),objectId:Z,recordId:Z}),$=r.string().min(1),Kt=r.discriminatedUnion(`command`,[r.strictObject({command:r.literal(`replace`),oldText:$,newText:r.string(),replaceAll:r.boolean().optional()}),r.strictObject({command:r.literal(`insert`),text:$,after:$.optional()})]),qt=r.strictObject({kind:r.literal(`record.patch`),objectId:Z,recordId:Z,attribute:r.string(),edit:Kt}),Jt=r.discriminatedUnion(`kind`,[Ht,Ut,Wt,Gt,qt]),Yt=r.strictObject({opId:Z,steps:r.array(Jt).min(1).max(100)}).superRefine((e,t)=>{let n=new Set;for(let r of e.steps){if(n.has(r.recordId)){t.addIssue({code:`custom`,message:`one step per record`,path:[`steps`]});return}n.add(r.recordId)}});Object.defineProperty(exports,"ACCESS_ROLES",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"AGENT_ASIDE_ANSWER_MAX_LENGTH",{enumerable:!0,get:function(){return 32e3}}),Object.defineProperty(exports,"AGENT_ASIDE_HISTORY_LIMIT",{enumerable:!0,get:function(){return 20}}),Object.defineProperty(exports,"AGENT_ASIDE_QUESTION_MAX_LENGTH",{enumerable:!0,get:function(){return 4e3}}),Object.defineProperty(exports,"AGENT_AVATAR_EXPRESSIONS",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"AGENT_AVATAR_TYPES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"AGENT_MESSAGE_KIND",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"AGENT_NOTIFICATION_KIND",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"AGENT_SESSION_LIST_ORDERS",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"AGENT_SESSION_ORIGINS",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"AGENT_STARTERS_MAX",{enumerable:!0,get:function(){return 4}}),Object.defineProperty(exports,"AGENT_STARTER_MAX_LENGTH",{enumerable:!0,get:function(){return 200}}),Object.defineProperty(exports,"AGENT_TASK_KINDS",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"ALL_CATALOG_TOOL_NAMES",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"ALWAYS_KINDS",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"APPROVAL_FAMILY_TOOL_NAMES",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"ASK_QUESTIONS_ANSWER_MAX_LENGTH",{enumerable:!0,get:function(){return 2e3}}),Object.defineProperty(exports,"ASK_QUESTIONS_ANSWER_MAX_VALUES",{enumerable:!0,get:function(){return 50}}),Object.defineProperty(exports,"ASK_QUESTIONS_MAX_BATCH",{enumerable:!0,get:function(){return 4}}),Object.defineProperty(exports,"ASK_QUESTIONS_TOOL_NAME",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"AUDIT_ACTIONS",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"AUDIT_AGENT_SESSION_METADATA_KEY",{enumerable:!0,get:function(){return`agentSessionId`}}),Object.defineProperty(exports,"AUDIT_RESOURCE_TYPES",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"AgentBuilder",{enumerable:!0,get:function(){return AgentBuilder}}),Object.defineProperty(exports,"BROWSER_LAUNCH_TOOL_NAME",{enumerable:!0,get:function(){return`browser_launch`}}),Object.defineProperty(exports,"CONNECTION_GRANT_PROVIDERS",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"CONTINUATION_KEY_PATTERN",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,"CONVERSATION_SURFACES",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"CORE_RECORD_TOOL_NAMES",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"CORE_TOOL_NAMES",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"DEFAULT_AGENT_EXECUTION_CONFIG",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"DEFAULT_AGENT_TOOL_GROUPS",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"DEFAULT_APPROVAL_POLICY",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"DEFAULT_BLUEPRINT_TOOL_GROUPS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"DEFAULT_DAILY_ACTIVITY_DAYS",{enumerable:!0,get:function(){return 182}}),Object.defineProperty(exports,"DEFAULT_MEETING_BOT_DISPLAY_NAME",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"DEFAULT_TENANT_SETTINGS",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"DISCARD_ARCHITECT_DRAFT_TOOL_NAME",{enumerable:!0,get:function(){return`discard_architect_draft`}}),Object.defineProperty(exports,"DOCUMENT_SORT_MODES",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"DRAFT_WRITE_TOOL_NAMES",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"EMAIL_CATEGORY_DEFAULT_COLOR",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"EMAIL_CATEGORY_DEFAULT_ICON",{enumerable:!0,get:function(){return`tag`}}),Object.defineProperty(exports,"EMAIL_CATEGORY_DESCRIPTION_MAX",{enumerable:!0,get:function(){return 500}}),Object.defineProperty(exports,"EMAIL_CATEGORY_DESCRIPTION_MIN",{enumerable:!0,get:function(){return 10}}),Object.defineProperty(exports,"EMAIL_CATEGORY_LIMIT",{enumerable:!0,get:function(){return 8}}),Object.defineProperty(exports,"EMAIL_CATEGORY_NAME_MAX",{enumerable:!0,get:function(){return 24}}),Object.defineProperty(exports,"ENVIRONMENT_HARNESSES",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"ENVIRONMENT_HARNESS_SANDBOX_WORKDIR",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"ENVIRONMENT_HARNESS_WORKDIR",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"ENVIRONMENT_NAME_MAX_CHARS",{enumerable:!0,get:function(){return 100}}),Object.defineProperty(exports,"ENVIRONMENT_STANDARDS_WORKDIR",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"ENV_VAR_KEY_PATTERN",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"FILE_URLS_MAX_IDS",{enumerable:!0,get:function(){return 200}}),Object.defineProperty(exports,"GET_ARCHITECT_DRAFT_TOOL_NAME",{enumerable:!0,get:function(){return`get_architect_draft`}}),Object.defineProperty(exports,"GITHUB_TRIGGER_CATALOG",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"GRANT_ENABLES",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"HITL_TOOL_NAMES",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"INFERENCE_REASONING_OPTIONS",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"INFERENCE_ROUTING_MODES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"INFERENCE_SPEEDS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"LAST_RUN_ERROR_MAX_LENGTH",{enumerable:!0,get:function(){return 200}}),Object.defineProperty(exports,"MAILBOX_LIST_MODES",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"MAIL_DRAFT_BODY_MAX_CHARS",{enumerable:!0,get:function(){return 2e5}}),Object.defineProperty(exports,"MAIL_SUBJECT_MAX_CHARS",{enumerable:!0,get:function(){return 998}}),Object.defineProperty(exports,"MAX_DAILY_ACTIVITY_DAYS",{enumerable:!0,get:function(){return 366}}),Object.defineProperty(exports,"MAX_TODOS",{enumerable:!0,get:function(){return 50}}),Object.defineProperty(exports,"MAX_TODO_DESCRIPTION_CHARS",{enumerable:!0,get:function(){return 500}}),Object.defineProperty(exports,"MAX_TODO_ID_CHARS",{enumerable:!0,get:function(){return 80}}),Object.defineProperty(exports,"MCP_SERVER_NAME_MAX_LENGTH",{enumerable:!0,get:function(){return 100}}),Object.defineProperty(exports,"MEETING_BOT_IMAGE",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"MEETING_BOT_IMAGE_BASE64_MAX_LENGTH",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"MEMORY_SPEND_LIMIT_PATTERN",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"McpOAuthCompletionMode",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"NATIVE_TOOL_GROUPS",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"NATIVE_TOOL_GROUP_CATALOG",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"NO_RECORDING",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"OPEN_TOOL_PART_STATES",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"OPERATION_MAX_STEPS",{enumerable:!0,get:function(){return 100}}),Object.defineProperty(exports,"PROVIDER_DRAFT_LABEL",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"PROVIDER_NAMES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"PUBLIC_MAIL_DOMAINS",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"QUESTION_FAMILY_TOOL_NAMES",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"RECENT_ACTIVITY_LEDGER_LIMIT",{enumerable:!0,get:function(){return 50}}),Object.defineProperty(exports,"RECORDING_OVERRIDES",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"RECORDING_POLICIES",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"RECORD_ACCESS_ROLES",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"RECORD_ACCESS_SOURCES",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"RECORD_DRIVE_CURSOR_MAX_LENGTH",{enumerable:!0,get:function(){return 2048}}),Object.defineProperty(exports,"RECORD_DRIVE_PAGE_DEFAULT_LIMIT",{enumerable:!0,get:function(){return 100}}),Object.defineProperty(exports,"RECORD_DRIVE_PAGE_MAX_LIMIT",{enumerable:!0,get:function(){return 500}}),Object.defineProperty(exports,"RECORD_GRAPH_DEFAULT_LIMIT_PER_NODE",{enumerable:!0,get:function(){return 50}}),Object.defineProperty(exports,"RECORD_GRAPH_MAX_LIMIT_PER_NODE",{enumerable:!0,get:function(){return 200}}),Object.defineProperty(exports,"RECORD_GRAPH_MAX_NODES",{enumerable:!0,get:function(){return 50}}),Object.defineProperty(exports,"RECORD_IMAGE_MAX_BYTES",{enumerable:!0,get:function(){return 5242880}}),Object.defineProperty(exports,"REPLY_MODES",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"REQUEST_DESIGN_REVIEW_TOOL_NAME",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"REQUEST_SETUP_TOOL_NAME",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"RESOURCE_GRANT_KINDS",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"RESOURCE_KIND_CATALOG",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"ROUTING_PRICE_CEILINGS",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"SESSION_INFERENCE_PATCH_KEYS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"SETUP_SCRIPT_MAX_CHARS",{enumerable:!0,get:function(){return 64e3}}),Object.defineProperty(exports,"SLACK_TRIGGER_CATALOG",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"SURFACE_TOOL_NAMES",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"SYSTEM_EMAIL_CATEGORIES",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"SYSTEM_EMAIL_CATEGORY_NAMES",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"SYSTEM_PART_CODES",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"TASK_DEMAND_LEVELS",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"TODO_PLAN_STATUSES",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"TODO_STATUSES",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"TOOL_APPROVAL_STATES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"TRIGGER_EVENT_TYPES",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,"TURN_OUTCOMES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"UNSHAREABLE_OBJECT_NAMES",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"USER_STATUSES",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"USER_WORK_POSTURES",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"VERB_NAMES",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"agent",{enumerable:!0,get:function(){return agent}}),Object.defineProperty(exports,"agentAvatarFromMetadata",{enumerable:!0,get:function(){return agentAvatarFromMetadata}}),Object.defineProperty(exports,"agentAvatarSchema",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"agentDataChunk",{enumerable:!0,get:function(){return agentDataChunk}}),Object.defineProperty(exports,"agentDisplayName",{enumerable:!0,get:function(){return agentDisplayName}}),Object.defineProperty(exports,"agentInferencePreferencesSchema",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"agentMessageAttachmentSchema",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"agentMessagePartSchema",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"agentScheduleSchema",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,"agentSessionInferenceOverridesInputSchema",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"agentSessionInferenceOverridesSchema",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"agentSessionMessageSchema",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"agentStartersSchema",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"agentTriggerBaseSchema",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"agentTriggerPatchSchema",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"agentTriggerSchema",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"agentUIValidationError",{enumerable:!0,get:function(){return agentUIValidationError}}),Object.defineProperty(exports,"artifactQuoteSchema",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"askQuestionsOutputSchema",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"assertCustomAgentUIMessageChunk",{enumerable:!0,get:function(){return assertCustomAgentUIMessageChunk}}),Object.defineProperty(exports,"assertSessionState",{enumerable:!0,get:function(){return assertSessionState}}),Object.defineProperty(exports,"canonicalToolGroups",{enumerable:!0,get:function(){return canonicalToolGroups}}),Object.defineProperty(exports,"classificationRestoreSchema",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"classifyEmailSchema",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"cliDefaultModelOf",{enumerable:!0,get:function(){return cliDefaultModelOf}}),Object.defineProperty(exports,"compareAgentSessionMessages",{enumerable:!0,get:function(){return compareAgentSessionMessages}}),Object.defineProperty(exports,"compiledHarnessModels",{enumerable:!0,get:function(){return compiledHarnessModels}}),Object.defineProperty(exports,"connectionGrantKindOf",{enumerable:!0,get:function(){return connectionGrantKindOf}}),Object.defineProperty(exports,"connectionGrantKindsOf",{enumerable:!0,get:function(){return connectionGrantKindsOf}}),Object.defineProperty(exports,"connectorTriggerMatchSchema",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"customDataChunkSchemas",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"deriveViewerAccess",{enumerable:!0,get:function(){return deriveViewerAccess}}),Object.defineProperty(exports,"durableDateSchema",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"emailCategoryCreateSchema",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"emailCategoryDeleteSchema",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"emailCategoryScopeQuerySchema",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"emailCategoryUpdateSchema",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"emailRuleScopeSchema",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"environmentHarness",{enumerable:!0,get:function(){return environmentHarness}}),Object.defineProperty(exports,"environmentWorkdir",{enumerable:!0,get:function(){return environmentWorkdir}}),Object.defineProperty(exports,"findEnvironmentHarness",{enumerable:!0,get:function(){return findEnvironmentHarness}}),Object.defineProperty(exports,"githubConditionSchema",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"githubTriggerMatchSchema",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"grantKindOf",{enumerable:!0,get:function(){return grantKindOf}}),Object.defineProperty(exports,"harnessModelChoices",{enumerable:!0,get:function(){return harnessModelChoices}}),Object.defineProperty(exports,"humanRequestId",{enumerable:!0,get:function(){return humanRequestId}}),Object.defineProperty(exports,"humanRequestKind",{enumerable:!0,get:function(){return humanRequestKind}}),Object.defineProperty(exports,"imageModelIdSchema",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"inferenceReasoningSchema",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"inferenceRoutingSchema",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"inferenceSpeedSchema",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"isAgentMessageMetadata",{enumerable:!0,get:function(){return isAgentMessageMetadata}}),Object.defineProperty(exports,"isAgentNotificationMetadata",{enumerable:!0,get:function(){return isAgentNotificationMetadata}}),Object.defineProperty(exports,"isAgentUIDataName",{enumerable:!0,get:function(){return isAgentUIDataName}}),Object.defineProperty(exports,"isAgentWrittenAuditEntry",{enumerable:!0,get:function(){return isAgentWrittenAuditEntry}}),Object.defineProperty(exports,"isAwaitingHuman",{enumerable:!0,get:function(){return isAwaitingHuman}}),Object.defineProperty(exports,"isBlocking",{enumerable:!0,get:function(){return isBlocking}}),Object.defineProperty(exports,"isEnvironmentHarnessId",{enumerable:!0,get:function(){return isEnvironmentHarnessId}}),Object.defineProperty(exports,"isMailProvider",{enumerable:!0,get:function(){return isMailProvider}}),Object.defineProperty(exports,"isMailboxListMode",{enumerable:!0,get:function(){return isMailboxListMode}}),Object.defineProperty(exports,"isNativeToolGroup",{enumerable:!0,get:function(){return isNativeToolGroup}}),Object.defineProperty(exports,"isOpenToolPartState",{enumerable:!0,get:function(){return isOpenToolPartState}}),Object.defineProperty(exports,"isParkedOnHuman",{enumerable:!0,get:function(){return isParkedOnHuman}}),Object.defineProperty(exports,"isProviderDraft",{enumerable:!0,get:function(){return isProviderDraft}}),Object.defineProperty(exports,"isPublicMailDomain",{enumerable:!0,get:function(){return isPublicMailDomain}}),Object.defineProperty(exports,"isReplyMode",{enumerable:!0,get:function(){return isReplyMode}}),Object.defineProperty(exports,"isResourceGrant",{enumerable:!0,get:function(){return isResourceGrant}}),Object.defineProperty(exports,"isRoutineActorMetadata",{enumerable:!0,get:function(){return isRoutineActorMetadata}}),Object.defineProperty(exports,"isSessionInferencePatch",{enumerable:!0,get:function(){return isSessionInferencePatch}}),Object.defineProperty(exports,"isSystemEmailCategory",{enumerable:!0,get:function(){return isSystemEmailCategory}}),Object.defineProperty(exports,"isSystemEmailCategoryName",{enumerable:!0,get:function(){return isSystemEmailCategoryName}}),Object.defineProperty(exports,"isSystemPartCode",{enumerable:!0,get:function(){return isSystemPartCode}}),Object.defineProperty(exports,"isToolApprovalState",{enumerable:!0,get:function(){return isToolApprovalState}}),Object.defineProperty(exports,"meetingBotDispatchRequestSchema",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"meetingBotDispatchResponseSchema",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"meetingBotNotificationSchema",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"meetingTranscriptSegmentSchema",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"mentionReferenceSchema",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"mergeSessionInferencePatch",{enumerable:!0,get:function(){return mergeSessionInferencePatch}}),Object.defineProperty(exports,"modelDefinitionSchema",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"modelReferenceSchema",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"needsManageWhenUnattended",{enumerable:!0,get:function(){return needsManageWhenUnattended}}),Object.defineProperty(exports,"normalizedMeetingTranscriptSchema",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"openRequests",{enumerable:!0,get:function(){return openRequests}}),Object.defineProperty(exports,"orderAgentSessionMessages",{enumerable:!0,get:function(){return orderAgentSessionMessages}}),Object.defineProperty(exports,"parseAgentDefinitionAccessRole",{enumerable:!0,get:function(){return parseAgentDefinitionAccessRole}}),Object.defineProperty(exports,"parseMergedAgentTrigger",{enumerable:!0,get:function(){return parseMergedAgentTrigger}}),Object.defineProperty(exports,"parsePageAccessRole",{enumerable:!0,get:function(){return parsePageAccessRole}}),Object.defineProperty(exports,"parseRecordAccessRole",{enumerable:!0,get:function(){return parseRecordAccessRole}}),Object.defineProperty(exports,"parseToolGroupGrant",{enumerable:!0,get:function(){return parseToolGroupGrant}}),Object.defineProperty(exports,"providerNameSchema",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"readAskQuestionsResult",{enumerable:!0,get:function(){return readAskQuestionsResult}}),Object.defineProperty(exports,"recentActivityEntryKey",{enumerable:!0,get:function(){return recentActivityEntryKey}}),Object.defineProperty(exports,"recordGraphNodeKey",{enumerable:!0,get:function(){return recordGraphNodeKey}}),Object.defineProperty(exports,"recordGraphRequestSchema",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"recordOperationSchema",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"refineTrigger",{enumerable:!0,get:function(){return refineTrigger}}),Object.defineProperty(exports,"resourceGrant",{enumerable:!0,get:function(){return resourceGrant}}),Object.defineProperty(exports,"routedMessageInferenceSchema",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"sessionInferencePatchSchema",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"slackConditionSchema",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"slackTriggerMatchSchema",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"todoItemSchema",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"todoPlanSchema",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"toolImpactSchema",{enumerable:!0,get:function(){return q}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
const e=require("./zod-locale.js"),t=require("./core-DAxRlJ5i.js");let n=require("zod");n=e.__toESM(n);const r={email:`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$`,url:`^https?:\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+[/#?]?.*$`,slug:`^[a-z0-9]+(?:-[a-z0-9]+)*$`};function resolveTextPattern(e){return e.pattern?e.pattern:e.format?r[e.format]:void 0}var LRUCache=class{constructor(e){if(!Number.isInteger(e)||e<=0)throw Error(`LRU cache capacity must be greater than 0`);this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let e=this.cache.keys().next();e.done||this.cache.delete(e.value)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}};function createRegexCache(e=100){return new LRUCache(e)}function getCachedRegex(e,t){let n=e.get(t);return n||(n=new RegExp(t),e.set(t,n)),n}const i=createRegexCache();function createTextValidator(e,r=t.DEFAULT_VALIDATION_MESSAGES){let a=n.string();e.minLength!==void 0&&(a=a.min(e.minLength,r.minLength(e,e.minLength))),e.maxLength!==void 0&&(a=a.max(e.maxLength,r.maxLength(e,e.maxLength)));let o=resolveTextPattern(e);return o&&(a=a.regex(getCachedRegex(i,o),r.invalidPattern(e))),a}Object.defineProperty(exports,"TEXT_FORMAT_PATTERNS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"createTextValidator",{enumerable:!0,get:function(){return createTextValidator}}),Object.defineProperty(exports,"resolveTextPattern",{enumerable:!0,get:function(){return resolveTextPattern}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
import"./zod-locale.mjs";import{DEFAULT_VALIDATION_MESSAGES as e}from"./core-rKI7Q9_U.mjs";import*as t from"zod";const n={email:`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$`,url:`^https?:\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+[/#?]?.*$`,slug:`^[a-z0-9]+(?:-[a-z0-9]+)*$`};function resolveTextPattern(e){return e.pattern?e.pattern:e.format?n[e.format]:void 0}var LRUCache=class{constructor(e){if(!Number.isInteger(e)||e<=0)throw Error(`LRU cache capacity must be greater than 0`);this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let e=this.cache.keys().next();e.done||this.cache.delete(e.value)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}};function createRegexCache(e=100){return new LRUCache(e)}function getCachedRegex(e,t){let n=e.get(t);return n||(n=new RegExp(t),e.set(t,n)),n}const r=createRegexCache();function createTextValidator(n,i=e){let a=t.string();n.minLength!==void 0&&(a=a.min(n.minLength,i.minLength(n,n.minLength))),n.maxLength!==void 0&&(a=a.max(n.maxLength,i.maxLength(n,n.maxLength)));let o=resolveTextPattern(n);return o&&(a=a.regex(getCachedRegex(r,o),i.invalidPattern(n))),a}export{n as TEXT_FORMAT_PATTERNS,createTextValidator,resolveTextPattern};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { TextAttribute } from "./attributes-BcA_reJZ.js";
|
|
3
|
+
import { ValidationMessages } from "./index-CCH94vyR.js";
|
|
4
|
+
import * as z$2 from "zod";
|
|
5
|
+
//#region src/validation/primitives/text.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Zod schema for a text attribute
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z$2.ZodString;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { TextAttribute } from "./attributes-eqr1vdPP.mjs";
|
|
3
|
+
import { ValidationMessages } from "./index-zJz3LbXr.mjs";
|
|
4
|
+
import * as z$2 from "zod";
|
|
5
|
+
//#region src/validation/primitives/text.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Zod schema for a text attribute
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z$2.ZodString;
|
|
10
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
const e=require("./exceptions.js");var NonJsonValueError=class extends e.SchemaError{constructor(){super(`Value must contain only JSON-compatible values`,e.SchemaErrorCode.VALIDATION_FAILED),this.name=`NonJsonValueError`}};const nonJsonValue=()=>new NonJsonValueError,t={refuseNonJson:!0,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},n={refuseNonJson:!1,refuseNonPlainObject:!1,refuseUnrepresentableType:!1,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},r={refuseNonJson:!1,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!0,unrepresentable:t=>new e.ValidationError(`Cannot canonicalize ${describeUnrepresentable(t)}`,[]),circular:()=>new e.ValidationError(`Cannot canonicalize circular structure`,[])};function describeUnrepresentable(e){if(typeof e!=`object`||!e)return`value of type ${typeof e}`;let t=e.constructor?.name;return typeof t==`string`&&t.length>0?`a ${t} value`:`a non-plain object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function assertArrayShape(e,t){if(Object.getPrototypeOf(e)!==Array.prototype||Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=Object.getOwnPropertyNames(e);if(n.length!==e.length+1||!n.includes(`length`))throw t.unrepresentable(e);for(let n=0;n<e.length;n+=1){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!(`value`in r)||r.enumerable!==!0)throw t.unrepresentable(e)}}function sortedEntries(e,t){if(t.refuseNonJson&&Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=[];for(let r of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||i.enumerable!==!0){if(t.refuseNonJson)throw t.unrepresentable(e);continue}if(!(`value`in i)){if(t.refuseNonJson)throw t.unrepresentable(e);if(!t.readAccessors)continue;let i=e[r];if(i===void 0)continue;n.push([r,i]);continue}i.value!==void 0&&n.push([r,i.value])}return n.sort(([e],[t])=>e<t?-1:+(e>t))}function serialize(e,t,n){if(e===null)return`null`;if(e===void 0){if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(Number.isFinite(e))return JSON.stringify(e);if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e!=`object`){if(t.refuseNonJson||t.refuseUnrepresentableType)throw t.unrepresentable(e);return JSON.stringify(String(e))}if(n.has(e))throw t.circular();n.add(e);try{if(Array.isArray(e)){t.refuseNonJson&&assertArrayShape(e,t);let r=[];for(let i=0;i<e.length;i+=1)r.push(serialize(e[i],t,n));return`[${r.join(`,`)}]`}if(t.refuseNonPlainObject&&!isPlainObject(e))throw t.unrepresentable(e);return`{${sortedEntries(e,t).map(([e,r])=>`${JSON.stringify(e)}:${serialize(r,t,n)}`).join(`,`)}}`}finally{n.delete(e)}}function canonicalStringify(e){return serialize(e,r,new Set)}function serializeStableJson(e){return serialize(e,n,new Set)}function serializeCanonicalJson(e){return serialize(e,t,new Set)}function sameStableValue(e,t){return serializeStableJson(e)===serializeStableJson(t)}function asTenantId(e){return e}function asUserId(e){return e}function generateId(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function indexBy(e,t){return new Map(e.map(e=>[t(e),e]))}function deepEqual(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>deepEqual(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>e in r&&deepEqual(n[e],r[e]))}return!1}Object.defineProperty(exports,"
|
|
2
|
+
const e=require("./exceptions.js");var NonJsonValueError=class extends e.SchemaError{constructor(){super(`Value must contain only JSON-compatible values`,e.SchemaErrorCode.VALIDATION_FAILED),this.name=`NonJsonValueError`}};const nonJsonValue=()=>new NonJsonValueError,t={refuseNonJson:!0,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},n={refuseNonJson:!1,refuseNonPlainObject:!1,refuseUnrepresentableType:!1,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},r={refuseNonJson:!1,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!0,unrepresentable:t=>new e.ValidationError(`Cannot canonicalize ${describeUnrepresentable(t)}`,[]),circular:()=>new e.ValidationError(`Cannot canonicalize circular structure`,[])};function describeUnrepresentable(e){if(typeof e!=`object`||!e)return`value of type ${typeof e}`;let t=e.constructor?.name;return typeof t==`string`&&t.length>0?`a ${t} value`:`a non-plain object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function assertArrayShape(e,t){if(Object.getPrototypeOf(e)!==Array.prototype||Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=Object.getOwnPropertyNames(e);if(n.length!==e.length+1||!n.includes(`length`))throw t.unrepresentable(e);for(let n=0;n<e.length;n+=1){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!(`value`in r)||r.enumerable!==!0)throw t.unrepresentable(e)}}function sortedEntries(e,t){if(t.refuseNonJson&&Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=[];for(let r of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||i.enumerable!==!0){if(t.refuseNonJson)throw t.unrepresentable(e);continue}if(!(`value`in i)){if(t.refuseNonJson)throw t.unrepresentable(e);if(!t.readAccessors)continue;let i=e[r];if(i===void 0)continue;n.push([r,i]);continue}i.value!==void 0&&n.push([r,i.value])}return n.sort(([e],[t])=>e<t?-1:+(e>t))}function serialize(e,t,n){if(e===null)return`null`;if(e===void 0){if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(Number.isFinite(e))return JSON.stringify(e);if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e!=`object`){if(t.refuseNonJson||t.refuseUnrepresentableType)throw t.unrepresentable(e);return JSON.stringify(String(e))}if(n.has(e))throw t.circular();n.add(e);try{if(Array.isArray(e)){t.refuseNonJson&&assertArrayShape(e,t);let r=[];for(let i=0;i<e.length;i+=1)r.push(serialize(e[i],t,n));return`[${r.join(`,`)}]`}if(t.refuseNonPlainObject&&!isPlainObject(e))throw t.unrepresentable(e);return`{${sortedEntries(e,t).map(([e,r])=>`${JSON.stringify(e)}:${serialize(r,t,n)}`).join(`,`)}}`}finally{n.delete(e)}}function canonicalStringify(e){return serialize(e,r,new Set)}function serializeStableJson(e){return serialize(e,n,new Set)}function serializeCanonicalJson(e){return serialize(e,t,new Set)}function sameStableValue(e,t){return serializeStableJson(e)===serializeStableJson(t)}function asTenantId(e){return e}function asUserId(e){return e}function generateId(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function indexBy(e,t){return new Map(e.map(e=>[t(e),e]))}function deepEqual(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>deepEqual(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>e in r&&deepEqual(n[e],r[e]))}return!1}Object.defineProperty(exports,"NonJsonValueError",{enumerable:!0,get:function(){return NonJsonValueError}}),Object.defineProperty(exports,"asTenantId",{enumerable:!0,get:function(){return asTenantId}}),Object.defineProperty(exports,"asUserId",{enumerable:!0,get:function(){return asUserId}}),Object.defineProperty(exports,"canonicalStringify",{enumerable:!0,get:function(){return canonicalStringify}}),Object.defineProperty(exports,"deepEqual",{enumerable:!0,get:function(){return deepEqual}}),Object.defineProperty(exports,"generateId",{enumerable:!0,get:function(){return generateId}}),Object.defineProperty(exports,"indexBy",{enumerable:!0,get:function(){return indexBy}}),Object.defineProperty(exports,"sameStableValue",{enumerable:!0,get:function(){return sameStableValue}}),Object.defineProperty(exports,"serializeCanonicalJson",{enumerable:!0,get:function(){return serializeCanonicalJson}}),Object.defineProperty(exports,"serializeStableJson",{enumerable:!0,get:function(){return serializeStableJson}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { SchemaError } from "./exceptions-CgzBcQIl.js";
|
|
3
3
|
//#region src/utils/stable-json.d.ts
|
|
4
|
-
declare class NonJsonValueError extends SchemaError {
|
|
4
|
+
export declare class NonJsonValueError extends SchemaError {
|
|
5
5
|
constructor();
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -20,18 +20,18 @@ declare class NonJsonValueError extends SchemaError {
|
|
|
20
20
|
* alike (#3406). Project such a value yourself (`date.toISOString()`,
|
|
21
21
|
* `[...map]`) before hashing it.
|
|
22
22
|
*/
|
|
23
|
-
declare function canonicalStringify(value: unknown): string;
|
|
23
|
+
export declare function canonicalStringify(value: unknown): string;
|
|
24
24
|
/**
|
|
25
25
|
* Key-sorted JSON for comparing values that round-trip through jsonb. Coerces
|
|
26
26
|
* what JSON cannot express rather than refusing — the caller is asking "are
|
|
27
27
|
* these the same?", not "is this valid?".
|
|
28
28
|
*/
|
|
29
|
-
declare function serializeStableJson(value: unknown): string;
|
|
29
|
+
export declare function serializeStableJson(value: unknown): string;
|
|
30
30
|
/**
|
|
31
31
|
* Key-sorted JSON for content identity. Throws {@link NonJsonValueError} on
|
|
32
32
|
* anything JSON cannot represent, so two different values never hash alike.
|
|
33
33
|
*/
|
|
34
|
-
declare function serializeCanonicalJson(value: unknown): string;
|
|
34
|
+
export declare function serializeCanonicalJson(value: unknown): string;
|
|
35
35
|
/**
|
|
36
36
|
* Order-insensitive deep equality over {@link serializeStableJson}.
|
|
37
37
|
*
|
|
@@ -39,7 +39,7 @@ declare function serializeCanonicalJson(value: unknown): string;
|
|
|
39
39
|
* allocating, and answers differently for `NaN`, for an explicitly-`undefined`
|
|
40
40
|
* entry, and for a cycle. Reach for this when the bytes are the point.
|
|
41
41
|
*/
|
|
42
|
-
declare function sameStableValue(left: unknown, right: unknown): boolean;
|
|
42
|
+
export declare function sameStableValue(left: unknown, right: unknown): boolean;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/utils.d.ts
|
|
45
45
|
/**
|
|
@@ -57,7 +57,7 @@ type Brand<T, B> = T & {
|
|
|
57
57
|
/**
|
|
58
58
|
* UUID string type for all identifiers
|
|
59
59
|
*/
|
|
60
|
-
type Uuid = string;
|
|
60
|
+
export type Uuid = string;
|
|
61
61
|
/**
|
|
62
62
|
* Tenant identifier for multi-tenant isolation.
|
|
63
63
|
* Branded type to prevent accidental mixing with other string IDs.
|
|
@@ -71,12 +71,12 @@ type Uuid = string;
|
|
|
71
71
|
* const wrong: TenantId = userId;
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
|
-
type TenantId = Brand<string, "TenantId">;
|
|
74
|
+
export type TenantId = Brand<string, "TenantId">;
|
|
75
75
|
/**
|
|
76
76
|
* User identifier for audit trails and permissions.
|
|
77
77
|
* Branded type to prevent accidental mixing with other string IDs.
|
|
78
78
|
*/
|
|
79
|
-
type UserId = Brand<string, "UserId">;
|
|
79
|
+
export type UserId = Brand<string, "UserId">;
|
|
80
80
|
/**
|
|
81
81
|
* Convert a string to a TenantId.
|
|
82
82
|
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
@@ -89,7 +89,7 @@ type UserId = Brand<string, "UserId">;
|
|
|
89
89
|
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
declare function asTenantId(id: string): TenantId;
|
|
92
|
+
export declare function asTenantId(id: string): TenantId;
|
|
93
93
|
/**
|
|
94
94
|
* Convert a string to a UserId.
|
|
95
95
|
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
@@ -102,7 +102,7 @@ declare function asTenantId(id: string): TenantId;
|
|
|
102
102
|
* const userId = asUserId(jwtPayload.sub);
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
|
-
declare function asUserId(id: string): UserId;
|
|
105
|
+
export declare function asUserId(id: string): UserId;
|
|
106
106
|
/**
|
|
107
107
|
* Generate a unique UUID v4
|
|
108
108
|
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
@@ -116,7 +116,7 @@ declare function asUserId(id: string): UserId;
|
|
|
116
116
|
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
|
-
declare function generateId(): Uuid;
|
|
119
|
+
export declare function generateId(): Uuid;
|
|
120
120
|
/**
|
|
121
121
|
* Create a Map indexed by a key extracted from each item.
|
|
122
122
|
* This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
|
|
@@ -139,7 +139,7 @@ declare function generateId(): Uuid;
|
|
|
139
139
|
* const attrMap = indexBy(attributes, a => a.name);
|
|
140
140
|
* ```
|
|
141
141
|
*/
|
|
142
|
-
declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
142
|
+
export declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
143
143
|
/**
|
|
144
144
|
* Deep equality comparison for plain objects and arrays.
|
|
145
145
|
* Handles nested structures, arrays, primitives, null, and undefined.
|
|
@@ -158,6 +158,5 @@ declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T)
|
|
|
158
158
|
* deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
|
-
declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
162
|
-
//#endregion
|
|
163
|
-
export { asUserId as a, indexBy as c, sameStableValue as d, serializeCanonicalJson as f, asTenantId as i, NonJsonValueError as l, UserId as n, deepEqual as o, serializeStableJson as p, Uuid as r, generateId as s, TenantId as t, canonicalStringify as u };
|
|
161
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
162
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { SchemaError } from "./exceptions-CgzBcQIl.mjs";
|
|
3
3
|
//#region src/utils/stable-json.d.ts
|
|
4
|
-
declare class NonJsonValueError extends SchemaError {
|
|
4
|
+
export declare class NonJsonValueError extends SchemaError {
|
|
5
5
|
constructor();
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -20,18 +20,18 @@ declare class NonJsonValueError extends SchemaError {
|
|
|
20
20
|
* alike (#3406). Project such a value yourself (`date.toISOString()`,
|
|
21
21
|
* `[...map]`) before hashing it.
|
|
22
22
|
*/
|
|
23
|
-
declare function canonicalStringify(value: unknown): string;
|
|
23
|
+
export declare function canonicalStringify(value: unknown): string;
|
|
24
24
|
/**
|
|
25
25
|
* Key-sorted JSON for comparing values that round-trip through jsonb. Coerces
|
|
26
26
|
* what JSON cannot express rather than refusing — the caller is asking "are
|
|
27
27
|
* these the same?", not "is this valid?".
|
|
28
28
|
*/
|
|
29
|
-
declare function serializeStableJson(value: unknown): string;
|
|
29
|
+
export declare function serializeStableJson(value: unknown): string;
|
|
30
30
|
/**
|
|
31
31
|
* Key-sorted JSON for content identity. Throws {@link NonJsonValueError} on
|
|
32
32
|
* anything JSON cannot represent, so two different values never hash alike.
|
|
33
33
|
*/
|
|
34
|
-
declare function serializeCanonicalJson(value: unknown): string;
|
|
34
|
+
export declare function serializeCanonicalJson(value: unknown): string;
|
|
35
35
|
/**
|
|
36
36
|
* Order-insensitive deep equality over {@link serializeStableJson}.
|
|
37
37
|
*
|
|
@@ -39,7 +39,7 @@ declare function serializeCanonicalJson(value: unknown): string;
|
|
|
39
39
|
* allocating, and answers differently for `NaN`, for an explicitly-`undefined`
|
|
40
40
|
* entry, and for a cycle. Reach for this when the bytes are the point.
|
|
41
41
|
*/
|
|
42
|
-
declare function sameStableValue(left: unknown, right: unknown): boolean;
|
|
42
|
+
export declare function sameStableValue(left: unknown, right: unknown): boolean;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/utils.d.ts
|
|
45
45
|
/**
|
|
@@ -57,7 +57,7 @@ type Brand<T, B> = T & {
|
|
|
57
57
|
/**
|
|
58
58
|
* UUID string type for all identifiers
|
|
59
59
|
*/
|
|
60
|
-
type Uuid = string;
|
|
60
|
+
export type Uuid = string;
|
|
61
61
|
/**
|
|
62
62
|
* Tenant identifier for multi-tenant isolation.
|
|
63
63
|
* Branded type to prevent accidental mixing with other string IDs.
|
|
@@ -71,12 +71,12 @@ type Uuid = string;
|
|
|
71
71
|
* const wrong: TenantId = userId;
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
|
-
type TenantId = Brand<string, "TenantId">;
|
|
74
|
+
export type TenantId = Brand<string, "TenantId">;
|
|
75
75
|
/**
|
|
76
76
|
* User identifier for audit trails and permissions.
|
|
77
77
|
* Branded type to prevent accidental mixing with other string IDs.
|
|
78
78
|
*/
|
|
79
|
-
type UserId = Brand<string, "UserId">;
|
|
79
|
+
export type UserId = Brand<string, "UserId">;
|
|
80
80
|
/**
|
|
81
81
|
* Convert a string to a TenantId.
|
|
82
82
|
* Use this when receiving tenant IDs from external sources (JWT, headers).
|
|
@@ -89,7 +89,7 @@ type UserId = Brand<string, "UserId">;
|
|
|
89
89
|
* const tenantId = asTenantId(request.headers['x-tenant-id']);
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
declare function asTenantId(id: string): TenantId;
|
|
92
|
+
export declare function asTenantId(id: string): TenantId;
|
|
93
93
|
/**
|
|
94
94
|
* Convert a string to a UserId.
|
|
95
95
|
* Use this when receiving user IDs from external sources (JWT, auth).
|
|
@@ -102,7 +102,7 @@ declare function asTenantId(id: string): TenantId;
|
|
|
102
102
|
* const userId = asUserId(jwtPayload.sub);
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
|
-
declare function asUserId(id: string): UserId;
|
|
105
|
+
export declare function asUserId(id: string): UserId;
|
|
106
106
|
/**
|
|
107
107
|
* Generate a unique UUID v4
|
|
108
108
|
* Uses crypto.randomUUID() when available (Node.js 19+, modern browsers)
|
|
@@ -116,7 +116,7 @@ declare function asUserId(id: string): UserId;
|
|
|
116
116
|
* // "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
|
-
declare function generateId(): Uuid;
|
|
119
|
+
export declare function generateId(): Uuid;
|
|
120
120
|
/**
|
|
121
121
|
* Create a Map indexed by a key extracted from each item.
|
|
122
122
|
* This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
|
|
@@ -139,7 +139,7 @@ declare function generateId(): Uuid;
|
|
|
139
139
|
* const attrMap = indexBy(attributes, a => a.name);
|
|
140
140
|
* ```
|
|
141
141
|
*/
|
|
142
|
-
declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
142
|
+
export declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
|
|
143
143
|
/**
|
|
144
144
|
* Deep equality comparison for plain objects and arrays.
|
|
145
145
|
* Handles nested structures, arrays, primitives, null, and undefined.
|
|
@@ -158,6 +158,5 @@ declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T)
|
|
|
158
158
|
* deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
|
-
declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
162
|
-
//#endregion
|
|
163
|
-
export { asUserId as a, indexBy as c, sameStableValue as d, serializeCanonicalJson as f, asTenantId as i, NonJsonValueError as l, UserId as n, deepEqual as o, serializeStableJson as p, Uuid as r, generateId as s, TenantId as t, canonicalStringify as u };
|
|
161
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
162
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
import{SchemaError as e,SchemaErrorCode as t,ValidationError as n}from"./exceptions.mjs";var NonJsonValueError=class extends e{constructor(){super(`Value must contain only JSON-compatible values`,t.VALIDATION_FAILED),this.name=`NonJsonValueError`}};const nonJsonValue=()=>new NonJsonValueError,r={refuseNonJson:!0,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},i={refuseNonJson:!1,refuseNonPlainObject:!1,refuseUnrepresentableType:!1,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},a={refuseNonJson:!1,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!0,unrepresentable:e=>new n(`Cannot canonicalize ${describeUnrepresentable(e)}`,[]),circular:()=>new n(`Cannot canonicalize circular structure`,[])};function describeUnrepresentable(e){if(typeof e!=`object`||!e)return`value of type ${typeof e}`;let t=e.constructor?.name;return typeof t==`string`&&t.length>0?`a ${t} value`:`a non-plain object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function assertArrayShape(e,t){if(Object.getPrototypeOf(e)!==Array.prototype||Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=Object.getOwnPropertyNames(e);if(n.length!==e.length+1||!n.includes(`length`))throw t.unrepresentable(e);for(let n=0;n<e.length;n+=1){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!(`value`in r)||r.enumerable!==!0)throw t.unrepresentable(e)}}function sortedEntries(e,t){if(t.refuseNonJson&&Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=[];for(let r of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||i.enumerable!==!0){if(t.refuseNonJson)throw t.unrepresentable(e);continue}if(!(`value`in i)){if(t.refuseNonJson)throw t.unrepresentable(e);if(!t.readAccessors)continue;let i=e[r];if(i===void 0)continue;n.push([r,i]);continue}i.value!==void 0&&n.push([r,i.value])}return n.sort(([e],[t])=>e<t?-1:+(e>t))}function serialize(e,t,n){if(e===null)return`null`;if(e===void 0){if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(Number.isFinite(e))return JSON.stringify(e);if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e!=`object`){if(t.refuseNonJson||t.refuseUnrepresentableType)throw t.unrepresentable(e);return JSON.stringify(String(e))}if(n.has(e))throw t.circular();n.add(e);try{if(Array.isArray(e)){t.refuseNonJson&&assertArrayShape(e,t);let r=[];for(let i=0;i<e.length;i+=1)r.push(serialize(e[i],t,n));return`[${r.join(`,`)}]`}if(t.refuseNonPlainObject&&!isPlainObject(e))throw t.unrepresentable(e);return`{${sortedEntries(e,t).map(([e,r])=>`${JSON.stringify(e)}:${serialize(r,t,n)}`).join(`,`)}}`}finally{n.delete(e)}}function canonicalStringify(e){return serialize(e,a,new Set)}function serializeStableJson(e){return serialize(e,i,new Set)}function serializeCanonicalJson(e){return serialize(e,r,new Set)}function sameStableValue(e,t){return serializeStableJson(e)===serializeStableJson(t)}function asTenantId(e){return e}function asUserId(e){return e}function generateId(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function indexBy(e,t){return new Map(e.map(e=>[t(e),e]))}function deepEqual(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>deepEqual(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>e in r&&deepEqual(n[e],r[e]))}return!1}export{
|
|
2
|
+
import{SchemaError as e,SchemaErrorCode as t,ValidationError as n}from"./exceptions.mjs";var NonJsonValueError=class extends e{constructor(){super(`Value must contain only JSON-compatible values`,t.VALIDATION_FAILED),this.name=`NonJsonValueError`}};const nonJsonValue=()=>new NonJsonValueError,r={refuseNonJson:!0,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},i={refuseNonJson:!1,refuseNonPlainObject:!1,refuseUnrepresentableType:!1,readAccessors:!1,unrepresentable:nonJsonValue,circular:nonJsonValue},a={refuseNonJson:!1,refuseNonPlainObject:!0,refuseUnrepresentableType:!0,readAccessors:!0,unrepresentable:e=>new n(`Cannot canonicalize ${describeUnrepresentable(e)}`,[]),circular:()=>new n(`Cannot canonicalize circular structure`,[])};function describeUnrepresentable(e){if(typeof e!=`object`||!e)return`value of type ${typeof e}`;let t=e.constructor?.name;return typeof t==`string`&&t.length>0?`a ${t} value`:`a non-plain object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function assertArrayShape(e,t){if(Object.getPrototypeOf(e)!==Array.prototype||Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=Object.getOwnPropertyNames(e);if(n.length!==e.length+1||!n.includes(`length`))throw t.unrepresentable(e);for(let n=0;n<e.length;n+=1){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!(`value`in r)||r.enumerable!==!0)throw t.unrepresentable(e)}}function sortedEntries(e,t){if(t.refuseNonJson&&Object.getOwnPropertySymbols(e).length>0)throw t.unrepresentable(e);let n=[];for(let r of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||i.enumerable!==!0){if(t.refuseNonJson)throw t.unrepresentable(e);continue}if(!(`value`in i)){if(t.refuseNonJson)throw t.unrepresentable(e);if(!t.readAccessors)continue;let i=e[r];if(i===void 0)continue;n.push([r,i]);continue}i.value!==void 0&&n.push([r,i.value])}return n.sort(([e],[t])=>e<t?-1:+(e>t))}function serialize(e,t,n){if(e===null)return`null`;if(e===void 0){if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e==`boolean`||typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(Number.isFinite(e))return JSON.stringify(e);if(t.refuseNonJson)throw t.unrepresentable(e);return`null`}if(typeof e!=`object`){if(t.refuseNonJson||t.refuseUnrepresentableType)throw t.unrepresentable(e);return JSON.stringify(String(e))}if(n.has(e))throw t.circular();n.add(e);try{if(Array.isArray(e)){t.refuseNonJson&&assertArrayShape(e,t);let r=[];for(let i=0;i<e.length;i+=1)r.push(serialize(e[i],t,n));return`[${r.join(`,`)}]`}if(t.refuseNonPlainObject&&!isPlainObject(e))throw t.unrepresentable(e);return`{${sortedEntries(e,t).map(([e,r])=>`${JSON.stringify(e)}:${serialize(r,t,n)}`).join(`,`)}}`}finally{n.delete(e)}}function canonicalStringify(e){return serialize(e,a,new Set)}function serializeStableJson(e){return serialize(e,i,new Set)}function serializeCanonicalJson(e){return serialize(e,r,new Set)}function sameStableValue(e,t){return serializeStableJson(e)===serializeStableJson(t)}function asTenantId(e){return e}function asUserId(e){return e}function generateId(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function indexBy(e,t){return new Map(e.map(e=>[t(e),e]))}function deepEqual(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>deepEqual(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>e in r&&deepEqual(n[e],r[e]))}return!1}export{NonJsonValueError,asTenantId,asUserId,canonicalStringify,deepEqual,generateId,indexBy,sameStableValue,serializeCanonicalJson,serializeStableJson};
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy } from "./utils-CRx-eR8T.mjs";
|
|
3
3
|
export { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy } from "./utils-B2bq4zLb.js";
|
|
3
3
|
export { TenantId, UserId, Uuid, asTenantId, asUserId, canonicalStringify, deepEqual, generateId, indexBy };
|
package/dist/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-B-gGq3FS.js");exports.asTenantId=e.asTenantId,exports.asUserId=e.asUserId,exports.canonicalStringify=e.canonicalStringify,exports.deepEqual=e.deepEqual,exports.generateId=e.generateId,exports.indexBy=e.indexBy;
|
package/dist/utils.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
-
import{
|
|
2
|
+
import{asTenantId as e,asUserId as t,canonicalStringify as n,deepEqual as r,generateId as i,indexBy as a}from"./utils-DaejNWxh.mjs";export{e as asTenantId,t as asUserId,n as canonicalStringify,r as deepEqual,i as generateId,a as indexBy};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { SCHEMA_LIMITS, collectionContentSourceSchema, colorIdSchema, contentViewDefinitionSchema, draftContentViewDefinitionSchema, iconNameSchema, publishedViewContentDefinitionSchema } from "../all-DIAipZSx.mjs";
|
|
3
|
+
import { SIMPLE_PROPERTY_TYPES, WIRE_OFFERED_BASE_CONFIG, WIRE_OMITTED_CONFIG_KEYS, attributeConfigSchemas, getAttributeConfigSchema, getAttributeConfigWriteSchema, multiselectOptionWriteSchema, parseAttributeConfig, parseAttributeConfigForCreate, parseAttributeConfigForUpdate, propertyAttributeSchema, propertyAttributeWireSchema, propertySchemaSchema, propertySchemaWireSchema, refuseForeignKeys, selectOptionWriteSchema, statusGroupSchema, statusOptionWriteSchema, wireHiddenTypeConfigMask, wireOmittedConfigKeysFor, withoutUnknownOptionKeys } from "../index-jDwfdudj.mjs";
|
|
4
|
+
import { DEFAULT_VALIDATION_MESSAGES, ValidationMessages, ValidationResult, formatZodErrors } from "../index-zJz3LbXr.mjs";
|
|
5
|
+
import { createAttributeValidator, createFormAttributeValidator, rejectUnknownAttributesOrThrow, validateAttribute, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow } from "../index-BSYjSdhW.mjs";
|
|
6
6
|
export { DEFAULT_VALIDATION_MESSAGES, SCHEMA_LIMITS, SIMPLE_PROPERTY_TYPES, type ValidationMessages, type ValidationResult, WIRE_OFFERED_BASE_CONFIG, WIRE_OMITTED_CONFIG_KEYS, attributeConfigSchemas, collectionContentSourceSchema, colorIdSchema, contentViewDefinitionSchema, createAttributeValidator, createFormAttributeValidator, draftContentViewDefinitionSchema, formatZodErrors, getAttributeConfigSchema, getAttributeConfigWriteSchema, iconNameSchema, multiselectOptionWriteSchema, parseAttributeConfig, parseAttributeConfigForCreate, parseAttributeConfigForUpdate, propertyAttributeSchema, propertyAttributeWireSchema, propertySchemaSchema, propertySchemaWireSchema, publishedViewContentDefinitionSchema, refuseForeignKeys, rejectUnknownAttributesOrThrow, selectOptionWriteSchema, statusGroupSchema, statusOptionWriteSchema, validateAttribute, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow, wireHiddenTypeConfigMask, wireOmittedConfigKeysFor, withoutUnknownOptionKeys };
|