terse-types 0.0.70 → 0.0.72
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/ApiRouteBuilder.d.ts +2 -0
- package/dist/ApiRoutes.json +3 -1
- package/dist/ToolDisplayUtils.js +108 -40
- package/dist/Tools.d.ts +3039 -389
- package/dist/Tools.js +585 -43
- package/dist/types.d.ts +25 -2
- package/dist/types.js +3 -1
- package/package.json +1 -1
|
@@ -88,6 +88,7 @@ export declare const ApiRoutes: {
|
|
|
88
88
|
INTEGRATIONS: string;
|
|
89
89
|
OAUTH_CALLBACK: string;
|
|
90
90
|
OBJECTS: string;
|
|
91
|
+
LISTS: string;
|
|
91
92
|
};
|
|
92
93
|
HEY_REACH: {
|
|
93
94
|
INTEGRATIONS: string;
|
|
@@ -167,6 +168,7 @@ export declare const ApiRoutes: {
|
|
|
167
168
|
LISTEN: string;
|
|
168
169
|
SUSPEND: string;
|
|
169
170
|
INPUT_REQUEST: string;
|
|
171
|
+
INPUT_RESPONSE: string;
|
|
170
172
|
CREATE_PROJECT: string;
|
|
171
173
|
DEPLOY: string;
|
|
172
174
|
IDENTIFY: string;
|
package/dist/ApiRoutes.json
CHANGED
|
@@ -87,7 +87,8 @@
|
|
|
87
87
|
"ATTIO": {
|
|
88
88
|
"INTEGRATIONS": "/attio/integrations",
|
|
89
89
|
"OAUTH_CALLBACK": "/attio/oauth/callback",
|
|
90
|
-
"OBJECTS": "/attio/integrations/:integrationId/objects"
|
|
90
|
+
"OBJECTS": "/attio/integrations/:integrationId/objects",
|
|
91
|
+
"LISTS": "/attio/integrations/:integrationId/lists"
|
|
91
92
|
},
|
|
92
93
|
"HEY_REACH": {
|
|
93
94
|
"INTEGRATIONS": "/heyreach/integrations",
|
|
@@ -167,6 +168,7 @@
|
|
|
167
168
|
"LISTEN": "/sdk/listen",
|
|
168
169
|
"SUSPEND": "/sdk/suspend",
|
|
169
170
|
"INPUT_REQUEST": "/sdk/input-request",
|
|
171
|
+
"INPUT_RESPONSE": "/sdk/input-request/:token/response",
|
|
170
172
|
"CREATE_PROJECT": "/sdk/projects",
|
|
171
173
|
"DEPLOY": "/sdk/deploy",
|
|
172
174
|
"IDENTIFY": "/sdk/auth/identify",
|
package/dist/ToolDisplayUtils.js
CHANGED
|
@@ -40,6 +40,62 @@ function memoryLabel(command, done) {
|
|
|
40
40
|
return done ? "Renamed memory file" : "Reorganizing memory";
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
function safeParseCount(result) {
|
|
44
|
+
const parsed = safeParseResult(result);
|
|
45
|
+
return typeof parsed?.count === "number" ? parsed.count : undefined;
|
|
46
|
+
}
|
|
47
|
+
function attioActionLabel(params, noun, done, count) {
|
|
48
|
+
const request = params?.request;
|
|
49
|
+
const action = request?.action ?? "";
|
|
50
|
+
const verbByPrefix = [
|
|
51
|
+
["list", ["Loading", "Loaded"]],
|
|
52
|
+
["query", ["Loading", "Loaded"]],
|
|
53
|
+
["get", ["Loading", "Loaded"]],
|
|
54
|
+
["create", ["Creating", "Created"]],
|
|
55
|
+
["add", ["Adding", "Added"]],
|
|
56
|
+
["upsert", ["Saving", "Saved"]],
|
|
57
|
+
["update", ["Updating", "Updated"]],
|
|
58
|
+
["upload", ["Uploading", "Uploaded"]],
|
|
59
|
+
["delete", ["Deleting", "Deleted"]],
|
|
60
|
+
["remove", ["Removing", "Removed"]]
|
|
61
|
+
];
|
|
62
|
+
const match = verbByPrefix.find(([prefix]) => action.startsWith(prefix));
|
|
63
|
+
const verb = match ? match[1][done ? 1 : 0] : done ? "Finished" : "Working with";
|
|
64
|
+
const plural = action.startsWith("list") || action.startsWith("query");
|
|
65
|
+
if (done && count !== undefined && plural)
|
|
66
|
+
return `${verb} ${count} ${noun}${count !== 1 ? "s" : ""}`;
|
|
67
|
+
return `${verb} ${noun}${plural ? "s" : ""}`;
|
|
68
|
+
}
|
|
69
|
+
function attioRecordsRequest(params) {
|
|
70
|
+
const request = params?.request;
|
|
71
|
+
return request && typeof request === "object" && "action" in request ? request : undefined;
|
|
72
|
+
}
|
|
73
|
+
function attioRecordsLabel(request, done, count) {
|
|
74
|
+
if (!request)
|
|
75
|
+
return done ? "Updated records" : "Working with records";
|
|
76
|
+
const target = `${request.objectSlug} record`;
|
|
77
|
+
switch (request.action) {
|
|
78
|
+
case "query":
|
|
79
|
+
case "search":
|
|
80
|
+
if (done && count !== undefined)
|
|
81
|
+
return `Found ${count} ${target}${count !== 1 ? "s" : ""}`;
|
|
82
|
+
return (done ? "Searched" : "Searching") + ` ${target}s`;
|
|
83
|
+
case "get":
|
|
84
|
+
return (done ? "Loaded" : "Loading") + ` ${target}`;
|
|
85
|
+
case "get_attribute_history":
|
|
86
|
+
return (done ? "Loaded" : "Loading") + ` ${target} history`;
|
|
87
|
+
case "create":
|
|
88
|
+
return (done ? "Created" : "Creating") + ` ${target}`;
|
|
89
|
+
case "update":
|
|
90
|
+
return (done ? "Updated" : "Updating") + ` ${target}`;
|
|
91
|
+
case "upsert":
|
|
92
|
+
if (done && count !== undefined && count !== 1)
|
|
93
|
+
return `Saved ${count} ${target}s`;
|
|
94
|
+
return (done ? "Saved" : "Saving") + ` ${target}`;
|
|
95
|
+
case "delete":
|
|
96
|
+
return (done ? "Deleted" : "Deleting") + ` ${target}`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
43
99
|
/**
|
|
44
100
|
* Display configurations for all tools.
|
|
45
101
|
* Each tool defines how it should be displayed in preparing, executing, and complete phases.
|
|
@@ -672,57 +728,69 @@ const TOOL_DISPLAY_CONFIG = {
|
|
|
672
728
|
// ===================
|
|
673
729
|
// Attio Tools
|
|
674
730
|
// ===================
|
|
675
|
-
|
|
676
|
-
preparing: "Getting
|
|
677
|
-
executing: params =>
|
|
678
|
-
const objectSlug = params?.objectSlug;
|
|
679
|
-
return objectSlug ? `Saving ${objectSlug} record` : "Saving record";
|
|
680
|
-
},
|
|
731
|
+
attio_records: {
|
|
732
|
+
preparing: "Getting records ready",
|
|
733
|
+
executing: params => attioRecordsLabel(attioRecordsRequest(params), false),
|
|
681
734
|
complete: (params, result) => {
|
|
682
735
|
const parsed = safeParseResult(result);
|
|
683
|
-
const
|
|
684
|
-
|
|
685
|
-
const objectSlug = params?.objectSlug;
|
|
686
|
-
if (target)
|
|
687
|
-
return `Saved ${objectSlug || "record"}: ${truncate(target, 30)}`;
|
|
688
|
-
if (objectSlug)
|
|
689
|
-
return `Saved ${objectSlug} record`;
|
|
690
|
-
return "Record saved";
|
|
736
|
+
const count = parsed?.count;
|
|
737
|
+
return attioRecordsLabel(attioRecordsRequest(params), true, count);
|
|
691
738
|
},
|
|
692
739
|
approval: params => {
|
|
693
|
-
const
|
|
694
|
-
|
|
740
|
+
const request = attioRecordsRequest(params);
|
|
741
|
+
const target = request ? `${request.objectSlug} record` : "record";
|
|
742
|
+
return request?.action === "delete" ? `Delete this ${target}? This cannot be undone.` : `Save ${target}?`;
|
|
695
743
|
}
|
|
696
744
|
},
|
|
697
|
-
|
|
698
|
-
preparing: "Looking up
|
|
745
|
+
attio_workspace_members: {
|
|
746
|
+
preparing: "Looking up workspace members",
|
|
699
747
|
executing: params => {
|
|
700
|
-
const
|
|
701
|
-
return
|
|
748
|
+
const request = params?.request;
|
|
749
|
+
return request?.action === "get" ? "Loading workspace member" : "Loading workspace members";
|
|
702
750
|
},
|
|
703
751
|
complete: (params, result) => {
|
|
704
752
|
const parsed = safeParseResult(result);
|
|
705
753
|
const count = parsed?.count;
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
708
|
-
return
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
754
|
+
const request = params?.request;
|
|
755
|
+
if (request?.action === "get")
|
|
756
|
+
return "Loaded workspace member";
|
|
757
|
+
return count !== undefined ? `Found ${count} workspace member${count !== 1 ? "s" : ""}` : "Workspace members loaded";
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
attio_tasks: {
|
|
761
|
+
preparing: "Working with tasks",
|
|
762
|
+
executing: params => attioActionLabel(params, "task", false),
|
|
763
|
+
complete: (params, result) => attioActionLabel(params, "task", true, safeParseCount(result))
|
|
764
|
+
},
|
|
765
|
+
attio_notes: {
|
|
766
|
+
preparing: "Working with notes",
|
|
767
|
+
executing: params => attioActionLabel(params, "note", false),
|
|
768
|
+
complete: (params, result) => attioActionLabel(params, "note", true, safeParseCount(result))
|
|
769
|
+
},
|
|
770
|
+
attio_comments: {
|
|
771
|
+
preparing: "Working with comments",
|
|
772
|
+
executing: params => attioActionLabel(params, "comment", false),
|
|
773
|
+
complete: (params, result) => attioActionLabel(params, "comment", true, safeParseCount(result))
|
|
774
|
+
},
|
|
775
|
+
attio_lists: {
|
|
776
|
+
preparing: "Working with lists",
|
|
777
|
+
executing: params => attioActionLabel(params, "list entry", false),
|
|
778
|
+
complete: (params, result) => attioActionLabel(params, "list entry", true, safeParseCount(result))
|
|
779
|
+
},
|
|
780
|
+
attio_meetings: {
|
|
781
|
+
preparing: "Loading meetings",
|
|
782
|
+
executing: params => attioActionLabel(params, "meeting", false),
|
|
783
|
+
complete: (params, result) => attioActionLabel(params, "meeting", true, safeParseCount(result))
|
|
784
|
+
},
|
|
785
|
+
attio_files: {
|
|
786
|
+
preparing: "Working with files",
|
|
787
|
+
executing: params => attioActionLabel(params, "file", false),
|
|
788
|
+
complete: (params, result) => attioActionLabel(params, "file", true, safeParseCount(result))
|
|
789
|
+
},
|
|
790
|
+
attio_schema: {
|
|
791
|
+
preparing: "Loading workspace schema",
|
|
792
|
+
executing: params => attioActionLabel(params, "schema item", false),
|
|
793
|
+
complete: (params, result) => attioActionLabel(params, "schema item", true, safeParseCount(result))
|
|
726
794
|
},
|
|
727
795
|
// ===================
|
|
728
796
|
// WorkOS Tools
|