From b9b93f7866b025ffa505185d7760cd9dea2fbe47 Mon Sep 17 00:00:00 2001 From: remiposo <57336808+remiposo@users.noreply.github.com> Date: Wed, 22 Apr 2026 16:04:10 +0900 Subject: [PATCH] feat(types): add tailor.context.getInvoker types Co-Authored-By: Claude Opus 4.7 (1M context) --- .changeset/add-context-get-invoker.md | 5 +++++ packages/types/tailor.d.ts | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .changeset/add-context-get-invoker.md diff --git a/.changeset/add-context-get-invoker.md b/.changeset/add-context-get-invoker.md new file mode 100644 index 0000000..419320f --- /dev/null +++ b/.changeset/add-context-get-invoker.md @@ -0,0 +1,5 @@ +--- +"@tailor-platform/function-types": patch +--- + +Add `tailor.context` namespace with `getInvoker()` for retrieving information about the invoker of the current function execution diff --git a/packages/types/tailor.d.ts b/packages/types/tailor.d.ts index 3c74f18..70070c2 100644 --- a/packages/types/tailor.d.ts +++ b/packages/types/tailor.d.ts @@ -495,4 +495,28 @@ declare namespace tailor.workflow { key: string, callback: (waitPayload: any) => any ): Promise; -} \ No newline at end of file +} + +declare namespace tailor.context { + /** + * Information about the invoker of the current function execution. + */ + interface Invoker { + /** The invoker's ID */ + id: string; + /** The invoker's type */ + type: "user" | "machine_user"; + /** The workspace ID */ + workspaceId: string; + /** The invoker's attribute IDs */ + attributes: string[]; + /** The invoker's attribute map */ + attributeMap: Record; + } + + /** + * Returns information about the invoker of the current function execution, + * or `null` for anonymous invocations. + */ + function getInvoker(): Invoker | null; +}