@holon-run/agentinbox 0.1.0

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.
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSourceSchema = getSourceSchema;
4
+ exports.listSourceSchemas = listSourceSchemas;
5
+ const SOURCE_SCHEMAS = {
6
+ fixture: {
7
+ sourceType: "fixture",
8
+ metadataFields: [],
9
+ payloadExamples: [
10
+ { text: "hello from fixture" },
11
+ ],
12
+ eventVariantExamples: ["message.created"],
13
+ configFields: [],
14
+ },
15
+ local_event: {
16
+ sourceType: "local_event",
17
+ metadataFields: [
18
+ { name: "channel", type: "string", description: "Producer-defined routing channel for local event ingress." },
19
+ { name: "subject", type: "string", description: "Producer-defined short summary or subject field." },
20
+ ],
21
+ payloadExamples: [
22
+ { text: "hello from local event source" },
23
+ ],
24
+ eventVariantExamples: ["message.created"],
25
+ configFields: [],
26
+ },
27
+ remote_source: {
28
+ sourceType: "remote_source",
29
+ metadataFields: [],
30
+ payloadExamples: [],
31
+ eventVariantExamples: [],
32
+ configFields: [
33
+ { name: "definition", type: "object", required: false, description: "Reserved for future declarative external source definitions." },
34
+ ],
35
+ },
36
+ github_repo: {
37
+ sourceType: "github_repo",
38
+ metadataFields: [
39
+ { name: "eventType", type: "string", description: "GitHub event type such as IssueCommentEvent." },
40
+ { name: "action", type: "string", description: "GitHub event action suffix such as created." },
41
+ { name: "author", type: "string|null", description: "Actor login for the event." },
42
+ { name: "isPullRequest", type: "boolean", description: "Whether the event targets a pull request surface." },
43
+ { name: "labels", type: "string[]", description: "Labels extracted from the issue or pull request." },
44
+ { name: "mentions", type: "string[]", description: "Mention handles extracted from title/body/comment text." },
45
+ { name: "number", type: "number|null", description: "Issue or pull request number when present." },
46
+ { name: "repoFullName", type: "string", description: "Repository full name in owner/repo form." },
47
+ { name: "title", type: "string|null", description: "Issue, pull request, or comment title." },
48
+ { name: "body", type: "string|null", description: "Issue, pull request, or comment body text." },
49
+ { name: "url", type: "string|null", description: "Primary GitHub HTML URL for the event target." },
50
+ ],
51
+ payloadExamples: [
52
+ {
53
+ id: "1234567890",
54
+ type: "IssueCommentEvent",
55
+ action: "created",
56
+ actor: "jolestar",
57
+ issue: { number: 12, title: "Track filtering work" },
58
+ comment: { body: "@alpha please look" },
59
+ },
60
+ ],
61
+ eventVariantExamples: ["IssueCommentEvent.created", "PullRequestEvent.opened", "PullRequestReviewCommentEvent.created"],
62
+ configFields: [
63
+ { name: "owner", type: "string", required: true, description: "GitHub repository owner." },
64
+ { name: "repo", type: "string", required: true, description: "GitHub repository name." },
65
+ { name: "uxcAuth", type: "string", required: false, description: "Optional uxc auth profile." },
66
+ { name: "eventTypes", type: "string[]", required: false, description: "Optional GitHub event type allowlist." },
67
+ ],
68
+ },
69
+ github_repo_ci: {
70
+ sourceType: "github_repo_ci",
71
+ metadataFields: [
72
+ { name: "name", type: "string|null", description: "Workflow run name." },
73
+ { name: "status", type: "string", description: "Normalized workflow run status." },
74
+ { name: "conclusion", type: "string|null", description: "Workflow run conclusion when completed." },
75
+ { name: "event", type: "string|null", description: "GitHub trigger event for the workflow run." },
76
+ { name: "headBranch", type: "string|null", description: "Head branch for the workflow run." },
77
+ { name: "headSha", type: "string|null", description: "Head commit SHA for the workflow run." },
78
+ { name: "actor", type: "string|null", description: "Actor login for the workflow run." },
79
+ { name: "commitMessage", type: "string|null", description: "Head commit message when present." },
80
+ { name: "htmlUrl", type: "string|null", description: "GitHub Actions run URL." },
81
+ ],
82
+ payloadExamples: [
83
+ {
84
+ id: 987,
85
+ name: "CI",
86
+ status: "completed",
87
+ conclusion: "failure",
88
+ event: "pull_request",
89
+ head_branch: "main",
90
+ actor: "jolestar",
91
+ head_commit: { message: "fix ci" },
92
+ },
93
+ ],
94
+ eventVariantExamples: ["workflow_run.ci.completed.failure", "workflow_run.nightly_checks.observed"],
95
+ configFields: [
96
+ { name: "owner", type: "string", required: true, description: "GitHub repository owner." },
97
+ { name: "repo", type: "string", required: true, description: "GitHub repository name." },
98
+ { name: "uxcAuth", type: "string", required: false, description: "Optional uxc auth profile." },
99
+ { name: "pollIntervalSecs", type: "number", required: false, description: "Polling interval in seconds." },
100
+ { name: "perPage", type: "number", required: false, description: "Workflow runs requested per poll." },
101
+ { name: "eventFilter", type: "string", required: false, description: "Optional GitHub workflow event filter." },
102
+ { name: "branch", type: "string", required: false, description: "Optional branch filter for workflow runs." },
103
+ { name: "statusFilter", type: "string", required: false, description: "Optional workflow status filter." },
104
+ ],
105
+ },
106
+ feishu_bot: {
107
+ sourceType: "feishu_bot",
108
+ metadataFields: [
109
+ { name: "eventType", type: "string", description: "Feishu event type." },
110
+ { name: "chatId", type: "string", description: "Target chat ID." },
111
+ { name: "chatType", type: "string|null", description: "Feishu chat type." },
112
+ { name: "messageId", type: "string", description: "Feishu message ID." },
113
+ { name: "messageType", type: "string", description: "Feishu message type such as text." },
114
+ { name: "senderOpenId", type: "string|null", description: "Sender open_id when present." },
115
+ { name: "senderType", type: "string|null", description: "Sender type." },
116
+ { name: "mentions", type: "string[]", description: "Mention names extracted from the message." },
117
+ { name: "mentionOpenIds", type: "string[]", description: "Mention open_ids extracted from the message." },
118
+ { name: "content", type: "string|null", description: "Normalized message content string." },
119
+ { name: "threadId", type: "string|null", description: "Thread or root message ID when present." },
120
+ { name: "parentId", type: "string|null", description: "Parent message ID when present." },
121
+ ],
122
+ payloadExamples: [
123
+ {
124
+ event_type: "im.message.receive_v1",
125
+ message: { chat_id: "oc_456", message_type: "text" },
126
+ sender: { sender_id: { open_id: "ou_alpha" } },
127
+ },
128
+ ],
129
+ eventVariantExamples: ["im.message.receive_v1.text"],
130
+ configFields: [
131
+ { name: "appId", type: "string", required: true, description: "Feishu app ID." },
132
+ { name: "appSecret", type: "string", required: true, description: "Feishu app secret." },
133
+ { name: "eventTypes", type: "string[]", required: false, description: "Optional Feishu event type allowlist." },
134
+ { name: "chatIds", type: "string[]", required: false, description: "Optional Feishu chat allowlist." },
135
+ { name: "schemaUrl", type: "string", required: false, description: "Optional Feishu OpenAPI schema URL." },
136
+ { name: "replyInThread", type: "boolean", required: false, description: "Reply in thread when sending outbound messages." },
137
+ { name: "uxcAuth", type: "string", required: false, description: "Optional uxc auth profile." },
138
+ ],
139
+ },
140
+ };
141
+ function getSourceSchema(sourceType) {
142
+ const schema = SOURCE_SCHEMAS[sourceType];
143
+ if (!schema) {
144
+ throw new Error(`unknown source type: ${sourceType}`);
145
+ }
146
+ return schema;
147
+ }
148
+ function listSourceSchemas() {
149
+ return Object.values(SOURCE_SCHEMAS);
150
+ }