@thecorporation/agent 26.3.3 → 26.3.5
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/extension/corp.ts +11 -3
- package/package.json +1 -1
package/extension/corp.ts
CHANGED
|
@@ -375,14 +375,22 @@ const getDocumentLink = {
|
|
|
375
375
|
const getSigningLink = {
|
|
376
376
|
name: "get_signing_link",
|
|
377
377
|
label: "Get Signing Link",
|
|
378
|
-
description: "Generate a signing link for a document. Returns a URL the user must open to sign. Documents can ONLY be signed through this link.",
|
|
378
|
+
description: "Generate a signing link for a document. Returns a URL with a signing token the user must open to sign. Documents can ONLY be signed through this link.",
|
|
379
379
|
parameters: Type.Object({
|
|
380
380
|
document_id: Type.String({ description: "The document ID to generate a signing link for" }),
|
|
381
|
+
entity_id: Type.String({ description: "The entity ID the document belongs to" }),
|
|
381
382
|
}),
|
|
382
383
|
async execute(toolCallId: string, params: any, signal: any) {
|
|
384
|
+
const qs = new URLSearchParams({ entity_id: params.entity_id }).toString();
|
|
385
|
+
const data = await apiCall("GET", `/v1/sign/${params.document_id}?${qs}`);
|
|
386
|
+
const signingUrl = data.token
|
|
387
|
+
? `https://humans.thecorporation.ai/sign/${params.document_id}?token=${data.token}`
|
|
388
|
+
: data.signing_url ?? `https://humans.thecorporation.ai/sign/${params.document_id}`;
|
|
383
389
|
const result = {
|
|
384
|
-
document_id: params.document_id,
|
|
385
|
-
signing_url:
|
|
390
|
+
document_id: data.document_id ?? params.document_id,
|
|
391
|
+
signing_url: signingUrl,
|
|
392
|
+
token: data.token,
|
|
393
|
+
message: "Open this link to sign the document. Only the authorized signer can complete the signature.",
|
|
386
394
|
};
|
|
387
395
|
return { content: [{ type: "text" as const, text: JSON.stringify(result) }], details: result };
|
|
388
396
|
},
|