@homingbird/mcp 0.3.0 → 0.3.1
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/homingbird-mcp.mjs +236 -19
- package/package.json +5 -5
package/dist/homingbird-mcp.mjs
CHANGED
|
@@ -2176,6 +2176,7 @@ var NoteBasis = schema_exports.string({ maxLength: NOTE_BASIS_MAX });
|
|
|
2176
2176
|
var PROFILE_MAX = 500;
|
|
2177
2177
|
var Role = schema_exports.tolerant(schema_exports.literal("member", "admin"), UNKNOWN);
|
|
2178
2178
|
var MemberStatus = schema_exports.tolerant(schema_exports.literal("active", "deactivated"), UNKNOWN);
|
|
2179
|
+
var MemberKind = schema_exports.tolerant(schema_exports.literal("person", "channel_agent"), UNKNOWN);
|
|
2179
2180
|
var LOCALES = ["en", "ko"];
|
|
2180
2181
|
var Locale = schema_exports.tolerant(schema_exports.literal(...LOCALES), UNKNOWN);
|
|
2181
2182
|
var DEFAULT_LOCALE = "en";
|
|
@@ -2186,6 +2187,7 @@ var Member = schema_exports.struct({
|
|
|
2186
2187
|
profile: schema_exports.string({ maxLength: PROFILE_MAX }),
|
|
2187
2188
|
role: Role,
|
|
2188
2189
|
status: MemberStatus,
|
|
2190
|
+
kind: MemberKind,
|
|
2189
2191
|
createdAt: Timestamp,
|
|
2190
2192
|
character: schema_exports.nullable(schema_exports.tolerant(CharacterSpec, null))
|
|
2191
2193
|
});
|
|
@@ -2203,6 +2205,10 @@ var Channel = schema_exports.struct({
|
|
|
2203
2205
|
answering: schema_exports.boolean,
|
|
2204
2206
|
managing: schema_exports.boolean,
|
|
2205
2207
|
managedBy: GroupId,
|
|
2208
|
+
/** The channel's own agent, with the `channelAgents` feature on. */
|
|
2209
|
+
agent: schema_exports.optional(schema_exports.nullable(schema_exports.struct({ id: MemberId, name: schema_exports.string({ maxLength: 200 }) }))),
|
|
2210
|
+
/** Whether the viewer manages the channel themself, and so runs its agent and reviews its answers. */
|
|
2211
|
+
runsAgent: schema_exports.optional(schema_exports.boolean),
|
|
2206
2212
|
createdAt: Timestamp
|
|
2207
2213
|
});
|
|
2208
2214
|
var ChannelMember = schema_exports.struct({ memberId: MemberId, answering: schema_exports.boolean, manager: schema_exports.boolean });
|
|
@@ -2254,6 +2260,8 @@ var Note = schema_exports.struct({
|
|
|
2254
2260
|
basis: schema_exports.optional(schema_exports.nullable(NoteBasis)),
|
|
2255
2261
|
agentClient: schema_exports.optional(schema_exports.nullable(AgentLabel)),
|
|
2256
2262
|
agentModel: schema_exports.optional(schema_exports.nullable(AgentLabel)),
|
|
2263
|
+
/** The person who approved a channel's agent's note; its author is the agent. */
|
|
2264
|
+
approvedBy: schema_exports.optional(schema_exports.nullable(MemberId)),
|
|
2257
2265
|
/** A debate room's approved result, posted by a person whose agent took part: which room, which agents. */
|
|
2258
2266
|
fromDebate: schema_exports.optional(
|
|
2259
2267
|
schema_exports.struct({
|
|
@@ -2300,8 +2308,13 @@ var Conversation = schema_exports.struct({
|
|
|
2300
2308
|
lastNote: schema_exports.nullable(Note),
|
|
2301
2309
|
unreadCount: schema_exports.int({ min: 0 }),
|
|
2302
2310
|
draftCount: schema_exports.int({ min: 0 }),
|
|
2303
|
-
archivedAt: schema_exports.nullable(Timestamp)
|
|
2311
|
+
archivedAt: schema_exports.nullable(Timestamp),
|
|
2312
|
+
/** A question asked privately of this channel's agent: its managers, now and later, take part. */
|
|
2313
|
+
privateQuestionOf: schema_exports.optional(schema_exports.nullable(ChannelSlug)),
|
|
2314
|
+
muted: schema_exports.optional(schema_exports.boolean)
|
|
2304
2315
|
});
|
|
2316
|
+
var NOTIFICATION_LEVELS = ["all", "direct", "none"];
|
|
2317
|
+
var NotificationLevel = schema_exports.tolerant(schema_exports.literal(...NOTIFICATION_LEVELS), UNKNOWN);
|
|
2305
2318
|
var CredentialKind = schema_exports.tolerant(schema_exports.literal("human", "agent"), UNKNOWN);
|
|
2306
2319
|
var Credential = schema_exports.struct({
|
|
2307
2320
|
id: CredentialId,
|
|
@@ -2350,6 +2363,37 @@ var Group = schema_exports.struct({
|
|
|
2350
2363
|
createdAt: Timestamp
|
|
2351
2364
|
});
|
|
2352
2365
|
|
|
2366
|
+
// ../protocol/src/channel-agents.ts
|
|
2367
|
+
var CHANNEL_AGENT_NAME_MAX = 80;
|
|
2368
|
+
var ChannelAgentName = schema_exports.refine(
|
|
2369
|
+
"channel-agent-name",
|
|
2370
|
+
(text) => text.trim() !== "" && !/[\p{Cc}\p{Cf}]/u.test(text),
|
|
2371
|
+
"expected one line of printable text"
|
|
2372
|
+
)(schema_exports.string({ minLength: 1, maxLength: CHANNEL_AGENT_NAME_MAX }));
|
|
2373
|
+
var AgentCredential = schema_exports.struct({
|
|
2374
|
+
id: CredentialId,
|
|
2375
|
+
name: schema_exports.string({ maxLength: 200 }),
|
|
2376
|
+
client: schema_exports.string({ maxLength: 200 }),
|
|
2377
|
+
createdAt: Timestamp,
|
|
2378
|
+
expiresAt: Timestamp,
|
|
2379
|
+
lastUsedAt: schema_exports.nullable(Timestamp),
|
|
2380
|
+
revokedAt: schema_exports.nullable(Timestamp),
|
|
2381
|
+
issuedBy: schema_exports.nullable(MemberId)
|
|
2382
|
+
});
|
|
2383
|
+
var ChannelAgent = schema_exports.struct({
|
|
2384
|
+
agent: Member,
|
|
2385
|
+
channel: ChannelSlug,
|
|
2386
|
+
credentials: schema_exports.array(AgentCredential, { maxItems: 200 })
|
|
2387
|
+
});
|
|
2388
|
+
var Review = schema_exports.struct({
|
|
2389
|
+
note: Note,
|
|
2390
|
+
question: schema_exports.nullable(Note),
|
|
2391
|
+
channel: ChannelSlug,
|
|
2392
|
+
agent: Member,
|
|
2393
|
+
privately: schema_exports.boolean
|
|
2394
|
+
});
|
|
2395
|
+
var AgentListing = schema_exports.struct({ member: Member, channel: schema_exports.nullable(ChannelSlug) });
|
|
2396
|
+
|
|
2353
2397
|
// ../protocol/src/character-link.ts
|
|
2354
2398
|
var characterLink = (webClientUrl, spec) => `${webClientUrl.replace(/\/+$/, "")}/#/${CHARACTER_ROUTE}/${encodeCharacter(spec)}`;
|
|
2355
2399
|
var CHARACTER_ROUTE = "character";
|
|
@@ -2483,6 +2527,7 @@ var EventBody = schema_exports.openVariants(
|
|
|
2483
2527
|
"channel.left": { slug: ChannelSlug, conversationId: ConversationId },
|
|
2484
2528
|
"debate.changed": { debateId: DebateId, participantIds: schema_exports.array(MemberId, { maxItems: 8 }) },
|
|
2485
2529
|
"group.changed": { groupId: GroupId },
|
|
2530
|
+
"review.changed": { noteId: schema_exports.nullable(NoteId) },
|
|
2486
2531
|
resync: {}
|
|
2487
2532
|
},
|
|
2488
2533
|
UNKNOWN_EVENT
|
|
@@ -2519,7 +2564,9 @@ var fillPath = (path, params) => path.replace(/:([A-Za-z]+)/g, (_, key) => {
|
|
|
2519
2564
|
var Empty = schema_exports.struct({});
|
|
2520
2565
|
var Digits = schema_exports.string({ pattern: /^[0-9]{1,15}$/ });
|
|
2521
2566
|
var PageLimit = schema_exports.string({ pattern: /^[0-9]{1,3}$/ });
|
|
2522
|
-
var
|
|
2567
|
+
var RECIPIENTS_MAX = 50;
|
|
2568
|
+
var Recipients = schema_exports.array(MemberId, { minItems: 1, maxItems: RECIPIENTS_MAX });
|
|
2569
|
+
var DraftAsShown = schema_exports.struct({ body: NoteBody, conversationId: ConversationId });
|
|
2523
2570
|
var InboxItem = schema_exports.struct({ note: Note, author: Member, conversation: Conversation });
|
|
2524
2571
|
var DeviceRequest = schema_exports.struct({
|
|
2525
2572
|
userCode: schema_exports.string(),
|
|
@@ -2544,7 +2591,8 @@ var Me = schema_exports.struct({
|
|
|
2544
2591
|
member: Member,
|
|
2545
2592
|
credential: schema_exports.struct({ id: CredentialId, kind: CredentialKind, name: schema_exports.string() }),
|
|
2546
2593
|
contactMode: ContactMode,
|
|
2547
|
-
locale: schema_exports.optional(Locale)
|
|
2594
|
+
locale: schema_exports.optional(Locale),
|
|
2595
|
+
notifications: schema_exports.optional(NotificationLevel)
|
|
2548
2596
|
});
|
|
2549
2597
|
|
|
2550
2598
|
// ../protocol/src/analytics-values.ts
|
|
@@ -2555,11 +2603,13 @@ var ANALYTICS_PAGES = [
|
|
|
2555
2603
|
"group",
|
|
2556
2604
|
"channels",
|
|
2557
2605
|
"channel",
|
|
2606
|
+
"channel-agent",
|
|
2558
2607
|
"debates",
|
|
2559
2608
|
"debate",
|
|
2560
2609
|
"search",
|
|
2561
2610
|
"profile",
|
|
2562
2611
|
"agent",
|
|
2612
|
+
"measured",
|
|
2563
2613
|
"character",
|
|
2564
2614
|
"device",
|
|
2565
2615
|
"consent",
|
|
@@ -2812,13 +2862,21 @@ var AgentPeriod = schema_exports.struct({
|
|
|
2812
2862
|
previous: AgentFigures
|
|
2813
2863
|
});
|
|
2814
2864
|
var TrustWeek = schema_exports.struct({ start: Timestamp, decided: count, sentAsWritten: count });
|
|
2865
|
+
var WeekFigures = schema_exports.struct({
|
|
2866
|
+
notesSent: count,
|
|
2867
|
+
repliesReceived: count,
|
|
2868
|
+
/** The typical time from a colleague's new note to the person's first reply to it. */
|
|
2869
|
+
medianReplyMs: schema_exports.nullable(count)
|
|
2870
|
+
});
|
|
2871
|
+
var YourWeek = schema_exports.struct({ days: schema_exports.int({ min: 1 }), current: WeekFigures, previous: WeekFigures });
|
|
2815
2872
|
var AgentReport = schema_exports.struct({
|
|
2816
2873
|
generatedAt: Timestamp,
|
|
2817
2874
|
quickApprovalSeconds: schema_exports.int({ min: 1 }),
|
|
2818
2875
|
minimumDecided: schema_exports.int({ min: 1 }),
|
|
2819
2876
|
periods: schema_exports.array(AgentPeriod),
|
|
2820
2877
|
weeks: schema_exports.array(TrustWeek),
|
|
2821
|
-
sessions: SessionHealth
|
|
2878
|
+
sessions: SessionHealth,
|
|
2879
|
+
week: schema_exports.optional(YourWeek)
|
|
2822
2880
|
});
|
|
2823
2881
|
var PlaceTotals = schema_exports.struct({
|
|
2824
2882
|
place: PlaceName,
|
|
@@ -2828,6 +2886,14 @@ var PlaceTotals = schema_exports.struct({
|
|
|
2828
2886
|
discarded: schema_exports.nullable(count),
|
|
2829
2887
|
skipped: count
|
|
2830
2888
|
});
|
|
2889
|
+
var Authorship = schema_exports.struct({ agent: count, humanEdited: count, human: count });
|
|
2890
|
+
var Delivery = schema_exports.struct({
|
|
2891
|
+
received: schema_exports.nullable(count),
|
|
2892
|
+
toAgents: count,
|
|
2893
|
+
pickedUpQuickly: count,
|
|
2894
|
+
medianPickupMs: schema_exports.nullable(count),
|
|
2895
|
+
waitedWithoutAgent: count
|
|
2896
|
+
});
|
|
2831
2897
|
var OrganizationFigures = schema_exports.struct({
|
|
2832
2898
|
activeMembers: count,
|
|
2833
2899
|
notesSent: count,
|
|
@@ -2846,20 +2912,32 @@ var OrganizationFigures = schema_exports.struct({
|
|
|
2846
2912
|
hiddenPlaces: count,
|
|
2847
2913
|
byClient: schema_exports.array(OrganizationLabelTotals),
|
|
2848
2914
|
byModel: schema_exports.array(OrganizationLabelTotals),
|
|
2849
|
-
hiddenLabels: count
|
|
2915
|
+
hiddenLabels: count,
|
|
2916
|
+
medianDecisionMs: schema_exports.optional(schema_exports.nullable(count)),
|
|
2917
|
+
authorship: schema_exports.optional(schema_exports.nullable(Authorship)),
|
|
2918
|
+
delivery: schema_exports.optional(schema_exports.nullable(Delivery))
|
|
2850
2919
|
});
|
|
2851
2920
|
var OrganizationPeriod = schema_exports.struct({
|
|
2852
2921
|
days: schema_exports.int({ min: 1 }),
|
|
2853
2922
|
current: schema_exports.nullable(OrganizationFigures),
|
|
2854
2923
|
previous: schema_exports.nullable(OrganizationFigures)
|
|
2855
2924
|
});
|
|
2925
|
+
var QuickWeek = schema_exports.struct({
|
|
2926
|
+
start: Timestamp,
|
|
2927
|
+
sentAsWritten: schema_exports.nullable(count),
|
|
2928
|
+
quickApprovals: schema_exports.nullable(count)
|
|
2929
|
+
});
|
|
2856
2930
|
var OrganizationInsights = schema_exports.struct({
|
|
2857
2931
|
generatedAt: Timestamp,
|
|
2858
2932
|
quickApprovalSeconds: schema_exports.int({ min: 1 }),
|
|
2859
2933
|
minimumGroupSize: schema_exports.int({ min: 1 }),
|
|
2860
2934
|
blocks: schema_exports.nullable(count),
|
|
2861
|
-
periods: schema_exports.array(OrganizationPeriod)
|
|
2935
|
+
periods: schema_exports.array(OrganizationPeriod),
|
|
2936
|
+
weeks: schema_exports.optional(schema_exports.array(QuickWeek)),
|
|
2937
|
+
quickWarning: schema_exports.optional(schema_exports.boolean)
|
|
2862
2938
|
});
|
|
2939
|
+
var QUICK_PICKUP_MS = 5 * 6e4;
|
|
2940
|
+
var PICKUP_WAIT_MS = 24 * 60 * 6e4;
|
|
2863
2941
|
|
|
2864
2942
|
// ../protocol/src/principles.ts
|
|
2865
2943
|
var PRINCIPLE_TOPIC_MAX = 80;
|
|
@@ -3037,6 +3115,13 @@ var contract = {
|
|
|
3037
3115
|
response: Member
|
|
3038
3116
|
}),
|
|
3039
3117
|
"me.character.clear": route({ method: "DELETE", path: "/me/character", access: "human", response: Member }),
|
|
3118
|
+
"me.notifications.set": route({
|
|
3119
|
+
method: "PUT",
|
|
3120
|
+
path: "/me/notifications",
|
|
3121
|
+
access: "human",
|
|
3122
|
+
body: schema_exports.struct({ notifications: schema_exports.literal(...NOTIFICATION_LEVELS) }),
|
|
3123
|
+
response: schema_exports.struct({ notifications: NotificationLevel })
|
|
3124
|
+
}),
|
|
3040
3125
|
"directory.list": route({
|
|
3041
3126
|
method: "GET",
|
|
3042
3127
|
path: "/directory",
|
|
@@ -3128,6 +3213,51 @@ var contract = {
|
|
|
3128
3213
|
body: schema_exports.struct({ groupId: GroupId }),
|
|
3129
3214
|
response: Channel
|
|
3130
3215
|
}),
|
|
3216
|
+
"channels.agent.get": route({
|
|
3217
|
+
method: "GET",
|
|
3218
|
+
path: "/channels/:slug/agent",
|
|
3219
|
+
access: "human",
|
|
3220
|
+
response: ChannelAgent
|
|
3221
|
+
}),
|
|
3222
|
+
"channels.agent.create": route({
|
|
3223
|
+
method: "PUT",
|
|
3224
|
+
path: "/channels/:slug/agent",
|
|
3225
|
+
access: "human",
|
|
3226
|
+
body: schema_exports.struct({ name: ChannelAgentName }),
|
|
3227
|
+
response: ChannelAgent
|
|
3228
|
+
}),
|
|
3229
|
+
"channels.agent.rename": route({
|
|
3230
|
+
method: "PATCH",
|
|
3231
|
+
path: "/channels/:slug/agent",
|
|
3232
|
+
access: "human",
|
|
3233
|
+
body: schema_exports.struct({ name: ChannelAgentName }),
|
|
3234
|
+
response: ChannelAgent
|
|
3235
|
+
}),
|
|
3236
|
+
"channels.agent.retire": route({
|
|
3237
|
+
method: "DELETE",
|
|
3238
|
+
path: "/channels/:slug/agent",
|
|
3239
|
+
access: "human",
|
|
3240
|
+
response: Empty
|
|
3241
|
+
}),
|
|
3242
|
+
"channels.agent.credentials.revoke": route({
|
|
3243
|
+
method: "DELETE",
|
|
3244
|
+
path: "/channels/:slug/agent/credentials/:id",
|
|
3245
|
+
access: "human",
|
|
3246
|
+
response: ChannelAgent
|
|
3247
|
+
}),
|
|
3248
|
+
"channels.askPrivately": route({
|
|
3249
|
+
method: "POST",
|
|
3250
|
+
path: "/channels/:slug/private-question",
|
|
3251
|
+
access: "human",
|
|
3252
|
+
response: Conversation
|
|
3253
|
+
}),
|
|
3254
|
+
"reviews.list": route({
|
|
3255
|
+
method: "GET",
|
|
3256
|
+
path: "/reviews",
|
|
3257
|
+
access: "human",
|
|
3258
|
+
response: schema_exports.struct({ reviews: schema_exports.array(Review) })
|
|
3259
|
+
}),
|
|
3260
|
+
"reviews.get": route({ method: "GET", path: "/reviews/:id", access: "human", response: Review }),
|
|
3131
3261
|
"groups.list": route({
|
|
3132
3262
|
method: "GET",
|
|
3133
3263
|
path: "/groups",
|
|
@@ -3198,6 +3328,18 @@ var contract = {
|
|
|
3198
3328
|
access: "member",
|
|
3199
3329
|
response: Conversation
|
|
3200
3330
|
}),
|
|
3331
|
+
"conversations.mute": route({
|
|
3332
|
+
method: "PUT",
|
|
3333
|
+
path: "/conversations/:id/mute",
|
|
3334
|
+
access: "human",
|
|
3335
|
+
response: Conversation
|
|
3336
|
+
}),
|
|
3337
|
+
"conversations.unmute": route({
|
|
3338
|
+
method: "DELETE",
|
|
3339
|
+
path: "/conversations/:id/mute",
|
|
3340
|
+
access: "human",
|
|
3341
|
+
response: Conversation
|
|
3342
|
+
}),
|
|
3201
3343
|
"conversations.notes": route({
|
|
3202
3344
|
method: "GET",
|
|
3203
3345
|
path: "/conversations/:id/notes",
|
|
@@ -3282,7 +3424,10 @@ var contract = {
|
|
|
3282
3424
|
method: "POST",
|
|
3283
3425
|
path: "/drafts/:id/send",
|
|
3284
3426
|
access: "human",
|
|
3285
|
-
body: schema_exports.struct({
|
|
3427
|
+
body: schema_exports.struct({
|
|
3428
|
+
body: schema_exports.optional(NoteBody),
|
|
3429
|
+
expected: DraftAsShown
|
|
3430
|
+
}),
|
|
3286
3431
|
response: Note
|
|
3287
3432
|
}),
|
|
3288
3433
|
"drafts.discard": route({ method: "POST", path: "/drafts/:id/discard", access: "human", response: Note }),
|
|
@@ -3512,7 +3657,9 @@ var contract = {
|
|
|
3512
3657
|
access: "human",
|
|
3513
3658
|
body: schema_exports.struct({
|
|
3514
3659
|
approve: schema_exports.boolean,
|
|
3515
|
-
name: schema_exports.optional(schema_exports.string({ minLength: 1, maxLength: 200 }))
|
|
3660
|
+
name: schema_exports.optional(schema_exports.string({ minLength: 1, maxLength: 200 })),
|
|
3661
|
+
/** Issues the credential to this channel's agent instead of the person deciding. */
|
|
3662
|
+
channel: schema_exports.optional(ChannelSlug)
|
|
3516
3663
|
}),
|
|
3517
3664
|
response: Empty
|
|
3518
3665
|
}),
|
|
@@ -3607,7 +3754,7 @@ var contract = {
|
|
|
3607
3754
|
method: "GET",
|
|
3608
3755
|
path: "/admin/members",
|
|
3609
3756
|
access: "admin",
|
|
3610
|
-
response: schema_exports.struct({ members: schema_exports.array(Member) })
|
|
3757
|
+
response: schema_exports.struct({ members: schema_exports.array(Member), agents: schema_exports.optional(schema_exports.array(AgentListing)) })
|
|
3611
3758
|
}),
|
|
3612
3759
|
"admin.members.update": route({
|
|
3613
3760
|
method: "PATCH",
|
|
@@ -3683,6 +3830,10 @@ var FEATURES = {
|
|
|
3683
3830
|
default: true,
|
|
3684
3831
|
routes: ["me.character.set", "me.character.clear", "admin.members.resetCharacter"]
|
|
3685
3832
|
},
|
|
3833
|
+
mute: {
|
|
3834
|
+
default: true,
|
|
3835
|
+
routes: ["conversations.mute", "conversations.unmute", "me.notifications.set"]
|
|
3836
|
+
},
|
|
3686
3837
|
webPush: { default: true, routes: ["push.key", "push.subscribe", "push.test", "push.unsubscribe"] },
|
|
3687
3838
|
answeringFlow: { default: true, routes: ["answeringFlow.get"] },
|
|
3688
3839
|
teaching: {
|
|
@@ -3718,6 +3869,19 @@ var FEATURES = {
|
|
|
3718
3869
|
"debates.export"
|
|
3719
3870
|
]
|
|
3720
3871
|
},
|
|
3872
|
+
channelAgents: {
|
|
3873
|
+
default: false,
|
|
3874
|
+
routes: [
|
|
3875
|
+
"channels.agent.get",
|
|
3876
|
+
"channels.agent.create",
|
|
3877
|
+
"channels.agent.rename",
|
|
3878
|
+
"channels.agent.retire",
|
|
3879
|
+
"channels.agent.credentials.revoke",
|
|
3880
|
+
"channels.askPrivately",
|
|
3881
|
+
"reviews.list",
|
|
3882
|
+
"reviews.get"
|
|
3883
|
+
]
|
|
3884
|
+
},
|
|
3721
3885
|
analytics: { default: false, routes: ["analytics.track"] }
|
|
3722
3886
|
};
|
|
3723
3887
|
var FEATURE_NAMES = Object.keys(FEATURES);
|
|
@@ -3867,10 +4031,13 @@ var AUDIT_EVENTS = {
|
|
|
3867
4031
|
"credential.issued": event("security", "credential", {
|
|
3868
4032
|
kind: CredentialKind,
|
|
3869
4033
|
grant: schema_exports.literal("browser", "device_code", "authorization_code"),
|
|
3870
|
-
clientKind: CLIENT_KIND
|
|
4034
|
+
clientKind: CLIENT_KIND,
|
|
4035
|
+
channelAgent: schema_exports.optional(MemberId)
|
|
3871
4036
|
}),
|
|
3872
4037
|
"credential.renamed": event("security", "credential", {}),
|
|
3873
|
-
"credential.revoked": event("security", "credential", {
|
|
4038
|
+
"credential.revoked": event("security", "credential", {
|
|
4039
|
+
because: schema_exports.optional(schema_exports.literal("issuer_left", "agent_retired"))
|
|
4040
|
+
}),
|
|
3874
4041
|
"credential.device_decided": event("security", "none", { approved: schema_exports.boolean }),
|
|
3875
4042
|
"credential.consent_decided": event("security", "auth_request", { approved: schema_exports.boolean }),
|
|
3876
4043
|
"oauth.client_registered": event("security", "oauth_client", { redirectHosts: hostList() }),
|
|
@@ -3908,11 +4075,18 @@ var AUDIT_EVENTS = {
|
|
|
3908
4075
|
removed: schema_exports.array(MemberId, { maxItems: GROUP_MEMBERS_MAX }),
|
|
3909
4076
|
because: schema_exports.optional(schema_exports.literal("deactivated"))
|
|
3910
4077
|
}),
|
|
3911
|
-
"note.approved": event("full", "note", {
|
|
4078
|
+
"note.approved": event("full", "note", {
|
|
4079
|
+
conversationId: ConversationId,
|
|
4080
|
+
edited: schema_exports.boolean,
|
|
4081
|
+
agentId: schema_exports.optional(MemberId)
|
|
4082
|
+
}),
|
|
3912
4083
|
"note.discarded": event("full", "note", { conversationId: ConversationId }),
|
|
3913
4084
|
"member.profile_changed": event("full", "member", {
|
|
3914
4085
|
fields: schema_exports.array(schema_exports.literal("name", "profile", "locale"), { maxItems: 3 })
|
|
3915
4086
|
}),
|
|
4087
|
+
"member.notifications_changed": event("full", "member", {
|
|
4088
|
+
notifications: schema_exports.literal(...NOTIFICATION_LEVELS)
|
|
4089
|
+
}),
|
|
3916
4090
|
"character.set": event("full", "member", {}),
|
|
3917
4091
|
"character.cleared": event("full", "member", {}),
|
|
3918
4092
|
"character.reset": event("full", "member", {}),
|
|
@@ -3928,12 +4102,19 @@ var AUDIT_EVENTS = {
|
|
|
3928
4102
|
"group.created": event("full", "group", { memberCount: schema_exports.int({ min: 0 }) }),
|
|
3929
4103
|
"group.renamed": event("full", "group", {}),
|
|
3930
4104
|
"group.deleted": event("full", "group", {}),
|
|
4105
|
+
"channel.agent_created": event("security", "member", { channel: ChannelSlug }),
|
|
4106
|
+
"channel.agent_renamed": event("full", "member", { channel: ChannelSlug }),
|
|
4107
|
+
"channel.agent_retired": event("security", "member", {
|
|
4108
|
+
channel: ChannelSlug,
|
|
4109
|
+
because: schema_exports.optional(schema_exports.literal("channel_archived"))
|
|
4110
|
+
}),
|
|
3931
4111
|
"channel.answering_changed": event("full", "channel", { on: schema_exports.boolean }),
|
|
3932
4112
|
"channel.renamed": event("full", "channel", {
|
|
3933
4113
|
fields: schema_exports.array(schema_exports.literal("slug", "description"), { maxItems: 2 }),
|
|
3934
4114
|
slug: schema_exports.optional(change(ChannelSlug))
|
|
3935
4115
|
}),
|
|
3936
4116
|
"channel.archived": event("full", "channel", { moveMembersTo: schema_exports.optional(ChannelSlug) }),
|
|
4117
|
+
"conversation.mute_changed": event("full", "conversation", { muted: schema_exports.boolean }),
|
|
3937
4118
|
"contact.requested": event("full", "member", {}),
|
|
3938
4119
|
"contact.accepted": event("full", "member", {}),
|
|
3939
4120
|
"contact.removed": event("full", "member", {}),
|
|
@@ -3986,6 +4167,7 @@ var ROUTE_AUDIT = {
|
|
|
3986
4167
|
"me.update": { event: "member.profile_changed", target: "member" },
|
|
3987
4168
|
"me.character.set": { event: "character.set", target: "member" },
|
|
3988
4169
|
"me.character.clear": { event: "character.cleared", target: "member" },
|
|
4170
|
+
"me.notifications.set": { event: "member.notifications_changed", target: "member" },
|
|
3989
4171
|
"directory.list": read(),
|
|
3990
4172
|
"channels.list": read(),
|
|
3991
4173
|
"channels.get": read(),
|
|
@@ -3999,6 +4181,14 @@ var ROUTE_AUDIT = {
|
|
|
3999
4181
|
"channels.members.add": { event: "channel.member_added", target: "channel" },
|
|
4000
4182
|
"channels.members.remove": { event: "channel.member_removed", target: "channel" },
|
|
4001
4183
|
"channels.managers.addTeam": { event: "group.members_changed", target: "group" },
|
|
4184
|
+
"channels.agent.get": read(),
|
|
4185
|
+
"channels.agent.create": { event: "channel.agent_created", target: "member" },
|
|
4186
|
+
"channels.agent.rename": { event: "channel.agent_renamed", target: "member" },
|
|
4187
|
+
"channels.agent.retire": { event: "channel.agent_retired", target: "member" },
|
|
4188
|
+
"channels.agent.credentials.revoke": { event: "credential.revoked", target: "credential" },
|
|
4189
|
+
"channels.askPrivately": activity(),
|
|
4190
|
+
"reviews.list": read(),
|
|
4191
|
+
"reviews.get": read(),
|
|
4002
4192
|
"groups.list": read(),
|
|
4003
4193
|
"groups.get": read(),
|
|
4004
4194
|
"groups.rename": { event: "group.renamed", target: "group" },
|
|
@@ -4012,6 +4202,8 @@ var ROUTE_AUDIT = {
|
|
|
4012
4202
|
"conversations.list": read(),
|
|
4013
4203
|
"conversations.create": activity(),
|
|
4014
4204
|
"conversations.get": read(),
|
|
4205
|
+
"conversations.mute": { event: "conversation.mute_changed", target: "conversation" },
|
|
4206
|
+
"conversations.unmute": { event: "conversation.mute_changed", target: "conversation" },
|
|
4015
4207
|
"conversations.notes": read(),
|
|
4016
4208
|
"notes.get": read(),
|
|
4017
4209
|
"notes.read": activity(),
|
|
@@ -4614,7 +4806,7 @@ var readCredentialsFile = (path, server) => task_exports.gen(function* () {
|
|
|
4614
4806
|
if ((yield* env.files.mode(path)) === null)
|
|
4615
4807
|
return yield* task_exports.fail(
|
|
4616
4808
|
CliFailure({
|
|
4617
|
-
message: `The credentials file ${path} does not exist. ${
|
|
4809
|
+
message: `The credentials file ${path} does not exist. ${createCredentialsFile(path, server)}`,
|
|
4618
4810
|
exitCode: EXIT.signedOut
|
|
4619
4811
|
})
|
|
4620
4812
|
);
|
|
@@ -4626,7 +4818,9 @@ var readCredentialsFile = (path, server) => task_exports.gen(function* () {
|
|
|
4626
4818
|
const decoded = StoredCredential.decode(parseJson(content));
|
|
4627
4819
|
if (decoded._tag === "Err")
|
|
4628
4820
|
return yield* task_exports.fail(
|
|
4629
|
-
failed(
|
|
4821
|
+
failed(
|
|
4822
|
+
`The credentials file ${path} does not hold an agent credential. ${createCredentialsFile(path, server)}`
|
|
4823
|
+
)
|
|
4630
4824
|
);
|
|
4631
4825
|
if (server !== null && serverKey(decoded.value.serverUrl) !== serverKey(server))
|
|
4632
4826
|
return yield* task_exports.fail(
|
|
@@ -4656,7 +4850,7 @@ var serverKey = (serverUrl) => {
|
|
|
4656
4850
|
var AGENTS_DIRECTORY = "agents";
|
|
4657
4851
|
var SUFFIX = ".json";
|
|
4658
4852
|
var SHARED_READ_BITS = 36;
|
|
4659
|
-
var
|
|
4853
|
+
var createCredentialsFile = (path, server) => `Create it on a computer where you can approve the sign-in: homingbird login --server ${server ?? "<url>"} --credentials-file ${path}`;
|
|
4660
4854
|
var agentsDirectory = (env) => `${credentialDirectory(env)}/${AGENTS_DIRECTORY}`;
|
|
4661
4855
|
var pathFor = (env, serverUrl) => `${agentsDirectory(env)}/${encodeURIComponent(serverKey(serverUrl))}${SUFFIX}`;
|
|
4662
4856
|
var parseJson = (content) => {
|
|
@@ -5327,6 +5521,14 @@ var summaryOf = (note) => ({
|
|
|
5327
5521
|
body: note.body
|
|
5328
5522
|
});
|
|
5329
5523
|
|
|
5524
|
+
// ../cli/src/web-client.ts
|
|
5525
|
+
var reviewLink = (serverUrl, slug) => `${serverUrl.replace(/\/+$/, "")}/#/channel/${encodeURIComponent(slug)}/agent`;
|
|
5526
|
+
var reviewChannelOf = (api, member) => member.kind !== "channel_agent" ? task_exports.succeed(null) : task_exports.catchAll(() => task_exports.succeed(null))(
|
|
5527
|
+
task_exports.map(
|
|
5528
|
+
(listed) => listed.channels.find((channel) => channel.agent?.id === member.id)?.slug ?? null
|
|
5529
|
+
)(api["channels.list"]({ query: { limit: "100" } }))
|
|
5530
|
+
);
|
|
5531
|
+
|
|
5330
5532
|
// ../cli/src/commands/logout.ts
|
|
5331
5533
|
var logout = task_exports.gen(function* () {
|
|
5332
5534
|
const env = yield* task_exports.ask();
|
|
@@ -5365,6 +5567,15 @@ var isRemoved = (path) => task_exports.gen(function* () {
|
|
|
5365
5567
|
});
|
|
5366
5568
|
var REVOKE_IN_WEB_CLIENT = "Revoke it in the web client's device list.";
|
|
5367
5569
|
|
|
5570
|
+
// ../cli/src/commands/open.ts
|
|
5571
|
+
var channelOfThisAgent = task_exports.catchAll(() => task_exports.succeed(null))(
|
|
5572
|
+
task_exports.gen(function* () {
|
|
5573
|
+
const { api } = yield* openSession;
|
|
5574
|
+
const me = yield* calling(api["me.get"]({}));
|
|
5575
|
+
return yield* reviewChannelOf(api, me.member);
|
|
5576
|
+
})
|
|
5577
|
+
);
|
|
5578
|
+
|
|
5368
5579
|
// ../cli/src/answering-flow.ts
|
|
5369
5580
|
var answeringFlowFor = (api, conversationId) => task_exports.gen(function* () {
|
|
5370
5581
|
const [flow, principles] = yield* task_exports.all([
|
|
@@ -5391,11 +5602,16 @@ var overview = task_exports.gen(function* () {
|
|
|
5391
5602
|
const me = yield* calling(api["me.get"]({}));
|
|
5392
5603
|
const parts = yield* task_exports.struct({ conversations, awaiting: inbox(false), drafts });
|
|
5393
5604
|
const answeringFlow = yield* answeringFlowFor(api);
|
|
5605
|
+
const reviewChannel = yield* reviewChannelOf(api, me.member);
|
|
5394
5606
|
return outcome(
|
|
5395
5607
|
{
|
|
5396
5608
|
signedIn: true,
|
|
5397
5609
|
server: credential.serverUrl,
|
|
5398
|
-
member: { id: me.member.id, name: me.member.name, email: me.member.email },
|
|
5610
|
+
member: { id: me.member.id, name: me.member.name, email: me.member.email, kind: me.member.kind },
|
|
5611
|
+
...reviewChannel !== null && {
|
|
5612
|
+
reviewChannel,
|
|
5613
|
+
reviewLink: reviewLink(credential.serverUrl, reviewChannel)
|
|
5614
|
+
},
|
|
5399
5615
|
...parts.conversations.json,
|
|
5400
5616
|
awaiting: parts.awaiting.json.items,
|
|
5401
5617
|
...parts.drafts.json,
|
|
@@ -5410,8 +5626,9 @@ var overview = task_exports.gen(function* () {
|
|
|
5410
5626
|
"Waiting for a reply",
|
|
5411
5627
|
parts.awaiting.text,
|
|
5412
5628
|
"",
|
|
5413
|
-
"Drafts waiting for approval"
|
|
5414
|
-
parts.drafts.text
|
|
5629
|
+
reviewChannel === null ? "Drafts waiting for approval" : `Drafts waiting for the managers of #${reviewChannel}`,
|
|
5630
|
+
parts.drafts.text,
|
|
5631
|
+
...reviewChannel === null ? [] : ["", `They review them at ${reviewLink(credential.serverUrl, reviewChannel)}`]
|
|
5415
5632
|
].join("\n")
|
|
5416
5633
|
);
|
|
5417
5634
|
});
|
|
@@ -8024,7 +8241,7 @@ ${USAGE2}` })
|
|
|
8024
8241
|
var ProgramFailed = tagged("ProgramFailed")();
|
|
8025
8242
|
|
|
8026
8243
|
// src/version.ts
|
|
8027
|
-
var ADAPTER_VERSION = "0.3.
|
|
8244
|
+
var ADAPTER_VERSION = "0.3.1";
|
|
8028
8245
|
|
|
8029
8246
|
// src/stdio.ts
|
|
8030
8247
|
var NONCE_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homingbird/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "MCP adapter for Homingbird: any MCP client reads and drafts notes, or runs your desk. You approve every note in the web client.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Minseon Kim (https://github.com/let-sunny)",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@homingbird/client": "0.3.
|
|
38
|
-
"@homingbird/kernel": "0.3.
|
|
39
|
-
"@homingbird/
|
|
40
|
-
"@homingbird/
|
|
37
|
+
"@homingbird/client": "0.3.1",
|
|
38
|
+
"@homingbird/kernel": "0.3.1",
|
|
39
|
+
"@homingbird/cli": "0.3.1",
|
|
40
|
+
"@homingbird/protocol": "0.3.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsx build.ts"
|