@xfey/tutti 0.1.103 → 0.1.104
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/README.md +9 -4
- package/dist/chat-assistant/index.d.ts +6 -1
- package/dist/chat-assistant/index.js +22 -12
- package/dist/collaboration-ingestion/external-source.d.ts +15 -0
- package/dist/collaboration-ingestion/external-source.js +120 -0
- package/dist/collaboration-ingestion/index.d.ts +5 -0
- package/dist/collaboration-ingestion/index.js +4 -0
- package/dist/collaboration-ingestion/invalidations.d.ts +4 -0
- package/dist/collaboration-ingestion/invalidations.js +15 -0
- package/dist/collaboration-ingestion/main-chat.d.ts +33 -0
- package/dist/collaboration-ingestion/main-chat.js +67 -0
- package/dist/collaboration-ingestion/reference-files.d.ts +29 -0
- package/dist/collaboration-ingestion/reference-files.js +158 -0
- package/dist/collaboration-ingestion/types.d.ts +19 -0
- package/dist/collaboration-ingestion/types.js +2 -0
- package/dist/platform-outbound/coordinator.d.ts +17 -0
- package/dist/platform-outbound/coordinator.js +48 -0
- package/dist/platform-outbound/index.d.ts +5 -0
- package/dist/platform-outbound/index.js +5 -0
- package/dist/platform-outbound/repository.d.ts +30 -0
- package/dist/platform-outbound/repository.js +108 -0
- package/dist/platform-outbound/types.d.ts +38 -0
- package/dist/platform-outbound/types.js +2 -0
- package/dist/platform-outbound/worker.d.ts +36 -0
- package/dist/platform-outbound/worker.js +164 -0
- package/dist/server-shell/cli/cli.js +9 -0
- package/dist/server-shell/cli/errors.d.ts +1 -1
- package/dist/server-shell/cli/host-lifecycle.d.ts +2 -0
- package/dist/server-shell/cli/host-lifecycle.js +34 -1
- package/dist/server-shell/cli/host-relay-connection-manager.js +22 -11
- package/dist/server-shell/cli/host-relay-status.js +1 -0
- package/dist/server-shell/cli/host-runtime-endpoint.js +17 -1
- package/dist/server-shell/cli/host-server-runtime.d.ts +2 -0
- package/dist/server-shell/cli/host-server-runtime.js +88 -14
- package/dist/server-shell/cli/launch-command.d.ts +7 -0
- package/dist/server-shell/cli/launch-command.js +39 -1
- package/dist/server-shell/cli/launch.d.ts +2 -0
- package/dist/server-shell/cli/launch.js +3 -0
- package/dist/server-shell/cli/machine-local.d.ts +20 -0
- package/dist/server-shell/cli/machine-local.js +61 -1
- package/dist/server-shell/cli/managed-host.d.ts +16 -1
- package/dist/server-shell/cli/managed-host.js +191 -23
- package/dist/server-shell/cli/relay-registration.d.ts +4 -1
- package/dist/server-shell/cli/relay-registration.js +36 -7
- package/dist/server-shell/cli/runtime-commands.d.ts +5 -1
- package/dist/server-shell/cli/runtime-commands.js +9 -3
- package/dist/server-shell/http/host-tunnel.d.ts +5 -0
- package/dist/server-shell/http/host-tunnel.js +109 -0
- package/dist/server-shell/http/routes/local-control.d.ts +2 -0
- package/dist/server-shell/http/routes/local-control.js +2 -0
- package/dist/server-shell/http/routes/project-api/invalidations.d.ts +0 -1
- package/dist/server-shell/http/routes/project-api/invalidations.js +0 -3
- package/dist/server-shell/http/routes/project-api/messages-routes.js +32 -63
- package/dist/server-shell/http/routes/project-api/openapi-workspace-routes.d.ts +8 -4
- package/dist/server-shell/http/routes/project-api/openapi.d.ts +8 -4
- package/dist/server-shell/http/routes/project-api/reference-files-routes.js +25 -94
- package/dist/server-shell/http/routes/project-api/reference-files.d.ts +1 -11
- package/dist/server-shell/http/routes/project-api/reference-files.js +2 -87
- package/dist/server-shell/http/routes/project-api/schemas.d.ts +8 -4
- package/dist/server-shell/http/routes/project-api/schemas.js +8 -3
- package/dist/server-shell/http/routes/project-api/session-requirements.js +34 -2
- package/dist/server-shell/http/routes/project-api/types.d.ts +3 -1
- package/dist/server-shell/http/routes/project-api/workspace-projections.js +8 -2
- package/dist/server-shell/local-console/package-update-hosts.js +4 -1
- package/dist/server-shell/local-console/project-service.d.ts +11 -2
- package/dist/server-shell/local-console/project-service.js +36 -8
- package/dist/server-shell/local-console/server.js +6 -1
- package/dist/server-shell/local-console/session.d.ts +4 -0
- package/dist/server-shell/local-console/session.js +14 -0
- package/dist/server-shell/session/relay-session-context.d.ts +12 -1
- package/dist/server-shell/session/relay-session-context.js +19 -1
- package/migrations/0016_external_source_mappings.sql +141 -0
- package/migrations/0017_platform_outbound_intents.sql +31 -0
- package/migrations/README.md +3 -1
- package/node_modules/@tutti/relay-client/dist/host-control.d.ts +26 -1
- package/node_modules/@tutti/relay-client/dist/host-control.js +62 -0
- package/node_modules/@tutti/relay-client/dist/tunnel-frames.js +32 -6
- package/node_modules/@tutti/relay-client/dist/tunnel-types.d.ts +5 -1
- package/node_modules/@tutti/shared/dist/domain/index.d.ts +9 -0
- package/node_modules/@tutti/shared/dist/domain/index.js +14 -0
- package/node_modules/@tutti/shared/dist/ids/index.d.ts +6 -0
- package/node_modules/@tutti/shared/dist/ids/index.js +4 -0
- package/node_modules/@tutti/shared/dist/schemas/api/index.d.ts +4 -0
- package/node_modules/@tutti/shared/dist/schemas/api/index.js +2 -0
- package/node_modules/@tutti/shared/dist/schemas/api/local-console-account-handoffs.d.ts +13 -0
- package/node_modules/@tutti/shared/dist/schemas/api/local-console-account-handoffs.js +16 -0
- package/node_modules/@tutti/shared/dist/schemas/api/platform-sessions.d.ts +43 -0
- package/node_modules/@tutti/shared/dist/schemas/api/platform-sessions.js +44 -0
- package/node_modules/@tutti/shared/dist/schemas/domain/index.d.ts +7 -0
- package/node_modules/@tutti/shared/dist/schemas/domain/index.js +10 -0
- package/node_modules/@tutti/shared/dist/schemas/internal/index.d.ts +29 -0
- package/node_modules/@tutti/shared/dist/schemas/internal/index.js +24 -1
- package/node_modules/@tutti/shared/dist/schemas/internal/platform-integration.d.ts +1346 -0
- package/node_modules/@tutti/shared/dist/schemas/internal/platform-integration.js +516 -0
- package/node_modules/@tutti/shared/dist/utils/feishu-diagnostics/index.d.ts +10 -0
- package/node_modules/@tutti/shared/dist/utils/feishu-diagnostics/index.js +19 -0
- package/node_modules/@tutti/shared/dist/utils/index.d.ts +1 -0
- package/node_modules/@tutti/shared/dist/utils/index.js +1 -0
- package/node_modules/@tutti/shared/dist/utils/redaction/index.d.ts +1 -1
- package/node_modules/@tutti/shared/dist/utils/redaction/index.js +18 -0
- package/package.json +1 -1
- package/web/assets/{homepage-motion-scene-CPs4EYQq.js → homepage-motion-scene-DEVrQ9aj.js} +1 -1
- package/web/assets/{index-CxCTqGFO.css → index-6i9Uk7fS.css} +1 -1
- package/web/assets/index-Lxtst2sl.js +69 -0
- package/web/index.html +2 -2
- package/web/assets/index-D3lwP_UR.js +0 -69
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Value } from "@sinclair/typebox/value";
|
|
3
|
+
import { IdempotencyKeySchema, IsoDateTimeStringSchema, MessageIdSchema, RelayAccountRefSchema, RelayProjectRefSchema, } from "../domain/index.js";
|
|
4
|
+
export const PlatformAdapterKeySchema = Type.String({
|
|
5
|
+
minLength: 1,
|
|
6
|
+
maxLength: 64,
|
|
7
|
+
pattern: "^[a-z][a-z0-9_-]*$",
|
|
8
|
+
});
|
|
9
|
+
export const IntegrationOwnedRefSchema = Type.String({
|
|
10
|
+
minLength: 1,
|
|
11
|
+
maxLength: 256,
|
|
12
|
+
pattern: "^[^\\u0000-\\u001f\\u007f]+$",
|
|
13
|
+
});
|
|
14
|
+
export const ExternalObjectRefSchema = Type.String({
|
|
15
|
+
minLength: 1,
|
|
16
|
+
maxLength: 512,
|
|
17
|
+
pattern: "^[^\\u0000-\\u001f\\u007f]+$",
|
|
18
|
+
});
|
|
19
|
+
export const PlatformInstallationLocatorSchema = Type.Object({
|
|
20
|
+
platform: PlatformAdapterKeySchema,
|
|
21
|
+
installation_ref: IntegrationOwnedRefSchema,
|
|
22
|
+
}, { additionalProperties: false });
|
|
23
|
+
export const PlatformConversationLocatorSchema = Type.Object({
|
|
24
|
+
installation: PlatformInstallationLocatorSchema,
|
|
25
|
+
conversation_ref: ExternalObjectRefSchema,
|
|
26
|
+
thread_ref: Type.Optional(ExternalObjectRefSchema),
|
|
27
|
+
parent_message_ref: Type.Optional(ExternalObjectRefSchema),
|
|
28
|
+
}, { additionalProperties: false });
|
|
29
|
+
export const ExternalMessageLocatorSchema = Type.Object({
|
|
30
|
+
conversation: PlatformConversationLocatorSchema,
|
|
31
|
+
message_ref: ExternalObjectRefSchema,
|
|
32
|
+
}, { additionalProperties: false });
|
|
33
|
+
export const ExternalSubjectLocatorSchema = Type.Object({
|
|
34
|
+
installation: PlatformInstallationLocatorSchema,
|
|
35
|
+
subject_kind: Type.Union([
|
|
36
|
+
Type.Literal("human"),
|
|
37
|
+
Type.Literal("bot"),
|
|
38
|
+
Type.Literal("app"),
|
|
39
|
+
Type.Literal("system"),
|
|
40
|
+
]),
|
|
41
|
+
subject_ref: ExternalObjectRefSchema,
|
|
42
|
+
}, { additionalProperties: false });
|
|
43
|
+
export const TrustedHumanIntegrationActorContextSchema = Type.Object({
|
|
44
|
+
kind: Type.Literal("human"),
|
|
45
|
+
account_ref: RelayAccountRefSchema,
|
|
46
|
+
display_name: Type.String({ minLength: 1, maxLength: 256 }),
|
|
47
|
+
membership: Type.Object({
|
|
48
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
49
|
+
label: Type.Union([Type.Literal("owner"), Type.Literal("member")]),
|
|
50
|
+
}, { additionalProperties: false }),
|
|
51
|
+
channel: Type.Union([
|
|
52
|
+
Type.Literal("platform_chat"),
|
|
53
|
+
Type.Literal("platform_h5"),
|
|
54
|
+
Type.Literal("platform_card_callback"),
|
|
55
|
+
]),
|
|
56
|
+
external_subject: ExternalSubjectLocatorSchema,
|
|
57
|
+
binding_ref: IntegrationOwnedRefSchema,
|
|
58
|
+
verified_at: IsoDateTimeStringSchema,
|
|
59
|
+
}, { additionalProperties: false });
|
|
60
|
+
export const TrustedSystemIntegrationActorContextSchema = Type.Object({
|
|
61
|
+
kind: Type.Literal("system"),
|
|
62
|
+
purpose: Type.Union([
|
|
63
|
+
Type.Literal("live_ingestion"),
|
|
64
|
+
Type.Literal("history_backfill"),
|
|
65
|
+
Type.Literal("revision_observation"),
|
|
66
|
+
Type.Literal("attachment_handoff"),
|
|
67
|
+
Type.Literal("projection_retry"),
|
|
68
|
+
Type.Literal("reconciliation"),
|
|
69
|
+
]),
|
|
70
|
+
installation: PlatformInstallationLocatorSchema,
|
|
71
|
+
binding_ref: Type.Optional(IntegrationOwnedRefSchema),
|
|
72
|
+
verified_at: IsoDateTimeStringSchema,
|
|
73
|
+
}, { additionalProperties: false });
|
|
74
|
+
export const TrustedIntegrationActorContextSchema = Type.Union([
|
|
75
|
+
TrustedHumanIntegrationActorContextSchema,
|
|
76
|
+
TrustedSystemIntegrationActorContextSchema,
|
|
77
|
+
]);
|
|
78
|
+
export const NormalizedConversationAuthorSchema = Type.Object({
|
|
79
|
+
account_ref: RelayAccountRefSchema,
|
|
80
|
+
display_name: Type.String({ minLength: 1, maxLength: 256 }),
|
|
81
|
+
external_subject: ExternalSubjectLocatorSchema,
|
|
82
|
+
}, { additionalProperties: false });
|
|
83
|
+
export const PreIdentityConversationAuthorSchema = Type.Object({
|
|
84
|
+
external_subject: ExternalSubjectLocatorSchema,
|
|
85
|
+
}, { additionalProperties: false });
|
|
86
|
+
export const NormalizedConversationMentionSchema = Type.Object({
|
|
87
|
+
external_subject: ExternalSubjectLocatorSchema,
|
|
88
|
+
account_ref: Type.Optional(RelayAccountRefSchema),
|
|
89
|
+
display_text: Type.Optional(Type.String({ minLength: 1, maxLength: 256 })),
|
|
90
|
+
target_kind: Type.Union([Type.Literal("person"), Type.Literal("tutti")]),
|
|
91
|
+
}, { additionalProperties: false });
|
|
92
|
+
export const NormalizedConversationContentSchema = Type.Union([
|
|
93
|
+
Type.Object({
|
|
94
|
+
kind: Type.Literal("text"),
|
|
95
|
+
text: Type.String({ minLength: 1, maxLength: 100_000 }),
|
|
96
|
+
mentions: Type.Array(NormalizedConversationMentionSchema, { maxItems: 128 }),
|
|
97
|
+
}, { additionalProperties: false }),
|
|
98
|
+
Type.Object({
|
|
99
|
+
kind: Type.Literal("post"),
|
|
100
|
+
text: Type.String({ minLength: 1, maxLength: 100_000 }),
|
|
101
|
+
mentions: Type.Array(NormalizedConversationMentionSchema, { maxItems: 128 }),
|
|
102
|
+
}, { additionalProperties: false }),
|
|
103
|
+
]);
|
|
104
|
+
export const ExternalAttachmentDescriptorSchema = Type.Object({
|
|
105
|
+
attachment_ref: ExternalObjectRefSchema,
|
|
106
|
+
attachment_kind: Type.Union([
|
|
107
|
+
Type.Literal("file"),
|
|
108
|
+
Type.Literal("image"),
|
|
109
|
+
Type.Literal("audio"),
|
|
110
|
+
Type.Literal("video"),
|
|
111
|
+
Type.Literal("other"),
|
|
112
|
+
]),
|
|
113
|
+
file_name: Type.Optional(Type.String({ minLength: 1, maxLength: 512 })),
|
|
114
|
+
media_type: Type.Optional(Type.String({ minLength: 1, maxLength: 255 })),
|
|
115
|
+
declared_size_bytes: Type.Optional(Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER })),
|
|
116
|
+
}, { additionalProperties: false });
|
|
117
|
+
export const VerifiedAttachmentContentMetadataSchema = Type.Object({
|
|
118
|
+
attachment: ExternalAttachmentDescriptorSchema,
|
|
119
|
+
size_bytes: Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }),
|
|
120
|
+
sha256: Type.String({ pattern: "^sha256:[0-9a-f]{64}$" }),
|
|
121
|
+
media_type: Type.String({ minLength: 1, maxLength: 255 }),
|
|
122
|
+
verified_at: IsoDateTimeStringSchema,
|
|
123
|
+
}, { additionalProperties: false });
|
|
124
|
+
export const NormalizedConversationSourceSchema = Type.Object({
|
|
125
|
+
locator: ExternalMessageLocatorSchema,
|
|
126
|
+
revision_ref: ExternalObjectRefSchema,
|
|
127
|
+
author: NormalizedConversationAuthorSchema,
|
|
128
|
+
content: NormalizedConversationContentSchema,
|
|
129
|
+
attachments: Type.Array(ExternalAttachmentDescriptorSchema, { maxItems: 64 }),
|
|
130
|
+
external_created_at: IsoDateTimeStringSchema,
|
|
131
|
+
observed_at: IsoDateTimeStringSchema,
|
|
132
|
+
adapter_version: Type.String({ minLength: 1, maxLength: 128 }),
|
|
133
|
+
}, { additionalProperties: false });
|
|
134
|
+
export const PreIdentityNormalizedConversationSourceSchema = Type.Object({
|
|
135
|
+
locator: ExternalMessageLocatorSchema,
|
|
136
|
+
revision_ref: ExternalObjectRefSchema,
|
|
137
|
+
author: PreIdentityConversationAuthorSchema,
|
|
138
|
+
content: NormalizedConversationContentSchema,
|
|
139
|
+
attachments: Type.Array(ExternalAttachmentDescriptorSchema, { maxItems: 64 }),
|
|
140
|
+
external_created_at: IsoDateTimeStringSchema,
|
|
141
|
+
observed_at: IsoDateTimeStringSchema,
|
|
142
|
+
adapter_version: Type.String({ minLength: 1, maxLength: 128 }),
|
|
143
|
+
}, { additionalProperties: false });
|
|
144
|
+
export const ExternalConversationRevisionObservationSchema = Type.Union([
|
|
145
|
+
Type.Object({
|
|
146
|
+
kind: Type.Literal("edited"),
|
|
147
|
+
locator: ExternalMessageLocatorSchema,
|
|
148
|
+
revision_ref: ExternalObjectRefSchema,
|
|
149
|
+
content: NormalizedConversationContentSchema,
|
|
150
|
+
attachments: Type.Array(ExternalAttachmentDescriptorSchema, { maxItems: 64 }),
|
|
151
|
+
external_updated_at: IsoDateTimeStringSchema,
|
|
152
|
+
observed_at: IsoDateTimeStringSchema,
|
|
153
|
+
adapter_version: Type.String({ minLength: 1, maxLength: 128 }),
|
|
154
|
+
}, { additionalProperties: false }),
|
|
155
|
+
Type.Object({
|
|
156
|
+
kind: Type.Literal("deleted"),
|
|
157
|
+
locator: ExternalMessageLocatorSchema,
|
|
158
|
+
revision_ref: ExternalObjectRefSchema,
|
|
159
|
+
external_updated_at: IsoDateTimeStringSchema,
|
|
160
|
+
observed_at: IsoDateTimeStringSchema,
|
|
161
|
+
adapter_version: Type.String({ minLength: 1, maxLength: 128 }),
|
|
162
|
+
}, { additionalProperties: false }),
|
|
163
|
+
]);
|
|
164
|
+
export const InboundIntegrationEventReceiptSchema = Type.Object({
|
|
165
|
+
receipt_key: IntegrationOwnedRefSchema,
|
|
166
|
+
installation: PlatformInstallationLocatorSchema,
|
|
167
|
+
external_event_ref: ExternalObjectRefSchema,
|
|
168
|
+
event_kind: Type.Union([
|
|
169
|
+
Type.Literal("conversation_source"),
|
|
170
|
+
Type.Literal("conversation_revision"),
|
|
171
|
+
Type.Literal("attachment"),
|
|
172
|
+
Type.Literal("card_action"),
|
|
173
|
+
]),
|
|
174
|
+
received_at: IsoDateTimeStringSchema,
|
|
175
|
+
attempt: Type.Integer({ minimum: 1, maximum: 1_000_000 }),
|
|
176
|
+
}, { additionalProperties: false });
|
|
177
|
+
export const ConversationSourceIngestionEnvelopeSchema = Type.Object({
|
|
178
|
+
kind: Type.Literal("conversation_source"),
|
|
179
|
+
receipt: InboundIntegrationEventReceiptSchema,
|
|
180
|
+
actor: TrustedSystemIntegrationActorContextSchema,
|
|
181
|
+
source: NormalizedConversationSourceSchema,
|
|
182
|
+
}, { additionalProperties: false });
|
|
183
|
+
export const ConversationRevisionIngestionEnvelopeSchema = Type.Object({
|
|
184
|
+
kind: Type.Literal("conversation_revision"),
|
|
185
|
+
receipt: InboundIntegrationEventReceiptSchema,
|
|
186
|
+
actor: TrustedSystemIntegrationActorContextSchema,
|
|
187
|
+
observation: ExternalConversationRevisionObservationSchema,
|
|
188
|
+
}, { additionalProperties: false });
|
|
189
|
+
export const ConversationIngestionEnvelopeSchema = Type.Union([
|
|
190
|
+
ConversationSourceIngestionEnvelopeSchema,
|
|
191
|
+
ConversationRevisionIngestionEnvelopeSchema,
|
|
192
|
+
]);
|
|
193
|
+
export const IntegrationDeliveryDispositionSchema = Type.Union([
|
|
194
|
+
Type.Object({ kind: Type.Literal("created"), message_id: MessageIdSchema }, { additionalProperties: false }),
|
|
195
|
+
Type.Object({ kind: Type.Literal("duplicate"), message_id: MessageIdSchema }, { additionalProperties: false }),
|
|
196
|
+
Type.Object({
|
|
197
|
+
kind: Type.Literal("revision_recorded"),
|
|
198
|
+
message_id: MessageIdSchema,
|
|
199
|
+
revision_ref: ExternalObjectRefSchema,
|
|
200
|
+
}, { additionalProperties: false }),
|
|
201
|
+
Type.Object({
|
|
202
|
+
kind: Type.Literal("stale_revision"),
|
|
203
|
+
message_id: MessageIdSchema,
|
|
204
|
+
revision_ref: ExternalObjectRefSchema,
|
|
205
|
+
}, { additionalProperties: false }),
|
|
206
|
+
Type.Object({
|
|
207
|
+
kind: Type.Literal("unsupported"),
|
|
208
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
209
|
+
}, { additionalProperties: false }),
|
|
210
|
+
Type.Object({
|
|
211
|
+
kind: Type.Literal("unauthorized"),
|
|
212
|
+
reason_code: Type.Optional(Type.String({ minLength: 1, maxLength: 128 })),
|
|
213
|
+
}, { additionalProperties: false }),
|
|
214
|
+
Type.Object({ kind: Type.Literal("binding_missing") }, { additionalProperties: false }),
|
|
215
|
+
Type.Object({
|
|
216
|
+
kind: Type.Literal("host_unavailable"),
|
|
217
|
+
retryable: Type.Literal(true),
|
|
218
|
+
reason_code: Type.Optional(Type.String({ minLength: 1, maxLength: 128 })),
|
|
219
|
+
retry_after: Type.Optional(IsoDateTimeStringSchema),
|
|
220
|
+
}, { additionalProperties: false }),
|
|
221
|
+
Type.Object({
|
|
222
|
+
kind: Type.Literal("host_incompatible"),
|
|
223
|
+
retryable: Type.Literal(true),
|
|
224
|
+
reason_code: Type.Literal("integration_source_ingestion_unsupported"),
|
|
225
|
+
}, { additionalProperties: false }),
|
|
226
|
+
Type.Object({
|
|
227
|
+
kind: Type.Literal("invalid"),
|
|
228
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
229
|
+
}, { additionalProperties: false }),
|
|
230
|
+
]);
|
|
231
|
+
export const IntegrationConversationSourceDeliveryRequestSchema = Type.Object({
|
|
232
|
+
protocol_version: Type.Literal(2),
|
|
233
|
+
command_id: IdempotencyKeySchema,
|
|
234
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
235
|
+
binding_ref: IntegrationOwnedRefSchema,
|
|
236
|
+
receipt: InboundIntegrationEventReceiptSchema,
|
|
237
|
+
source: PreIdentityNormalizedConversationSourceSchema,
|
|
238
|
+
}, { additionalProperties: false });
|
|
239
|
+
export const FEISHU_CONVERSATION_PAIRING_CODE_LENGTH = 20;
|
|
240
|
+
export const FeishuConversationPairingCodeSchema = Type.String({
|
|
241
|
+
minLength: FEISHU_CONVERSATION_PAIRING_CODE_LENGTH,
|
|
242
|
+
maxLength: FEISHU_CONVERSATION_PAIRING_CODE_LENGTH,
|
|
243
|
+
pattern: "^[A-Z2-7]+$",
|
|
244
|
+
});
|
|
245
|
+
export const FeishuSetupProjectionSchema = Type.Union([
|
|
246
|
+
Type.Object({ state: Type.Literal("account_handoff_required") }, { additionalProperties: false }),
|
|
247
|
+
Type.Object({
|
|
248
|
+
state: Type.Literal("pairing_required"),
|
|
249
|
+
pairing_code: FeishuConversationPairingCodeSchema,
|
|
250
|
+
command: Type.String({ minLength: 1, maxLength: 128 }),
|
|
251
|
+
expires_at: IsoDateTimeStringSchema,
|
|
252
|
+
visibility: Type.Literal("visible_once"),
|
|
253
|
+
}, { additionalProperties: false }),
|
|
254
|
+
Type.Object({
|
|
255
|
+
state: Type.Literal("pairing_required"),
|
|
256
|
+
expires_at: Type.Optional(IsoDateTimeStringSchema),
|
|
257
|
+
visibility: Type.Literal("not_recoverable"),
|
|
258
|
+
}, { additionalProperties: false }),
|
|
259
|
+
Type.Object({ state: Type.Literal("connected") }, { additionalProperties: false }),
|
|
260
|
+
]);
|
|
261
|
+
export const IntegrationConversationBindingRequestSchema = Type.Object({
|
|
262
|
+
protocol_version: Type.Literal(1),
|
|
263
|
+
pairing_code: FeishuConversationPairingCodeSchema,
|
|
264
|
+
binding_ref: IntegrationOwnedRefSchema,
|
|
265
|
+
installation: PlatformInstallationLocatorSchema,
|
|
266
|
+
conversation_ref: ExternalObjectRefSchema,
|
|
267
|
+
external_subject: ExternalSubjectLocatorSchema,
|
|
268
|
+
observed_at: IsoDateTimeStringSchema,
|
|
269
|
+
}, { additionalProperties: false });
|
|
270
|
+
export const IntegrationConversationBindingDispositionSchema = Type.Union([
|
|
271
|
+
Type.Object({
|
|
272
|
+
kind: Type.Literal("bound"),
|
|
273
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
274
|
+
project_display_name: Type.String({ minLength: 1, maxLength: 256 }),
|
|
275
|
+
}, { additionalProperties: false }),
|
|
276
|
+
Type.Object({
|
|
277
|
+
kind: Type.Literal("duplicate"),
|
|
278
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
279
|
+
project_display_name: Type.String({ minLength: 1, maxLength: 256 }),
|
|
280
|
+
}, { additionalProperties: false }),
|
|
281
|
+
Type.Object({
|
|
282
|
+
kind: Type.Literal("invalid"),
|
|
283
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
284
|
+
}, { additionalProperties: false }),
|
|
285
|
+
Type.Object({
|
|
286
|
+
kind: Type.Literal("unauthorized"),
|
|
287
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
288
|
+
}, { additionalProperties: false }),
|
|
289
|
+
Type.Object({
|
|
290
|
+
kind: Type.Literal("conflict"),
|
|
291
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
292
|
+
}, { additionalProperties: false }),
|
|
293
|
+
]);
|
|
294
|
+
export const IntegrationConversationBindingResponseSchema = Type.Object({
|
|
295
|
+
protocol_version: Type.Literal(1),
|
|
296
|
+
disposition: IntegrationConversationBindingDispositionSchema,
|
|
297
|
+
}, { additionalProperties: false });
|
|
298
|
+
export const INTEGRATION_CONVERSATION_SOURCE_TUNNEL_PATH = "/internal/integration/v1/conversation-sources";
|
|
299
|
+
export const TrustedConversationSourceIngestionCommandSchema = Type.Object({
|
|
300
|
+
protocol_version: Type.Literal(1),
|
|
301
|
+
command_id: IdempotencyKeySchema,
|
|
302
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
303
|
+
binding_ref: IntegrationOwnedRefSchema,
|
|
304
|
+
receipt: InboundIntegrationEventReceiptSchema,
|
|
305
|
+
actor: TrustedHumanIntegrationActorContextSchema,
|
|
306
|
+
source: NormalizedConversationSourceSchema,
|
|
307
|
+
}, { additionalProperties: false });
|
|
308
|
+
export const IntegrationDeliveryTunnelMetadataSchema = Type.Object({
|
|
309
|
+
protocol_version: Type.Literal(1),
|
|
310
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
311
|
+
installation: PlatformInstallationLocatorSchema,
|
|
312
|
+
binding_ref: IntegrationOwnedRefSchema,
|
|
313
|
+
receipt_key: IntegrationOwnedRefSchema,
|
|
314
|
+
verified_at: IsoDateTimeStringSchema,
|
|
315
|
+
}, { additionalProperties: false });
|
|
316
|
+
export const IntegrationConversationSourceDeliveryResponseSchema = Type.Object({
|
|
317
|
+
protocol_version: Type.Literal(1),
|
|
318
|
+
disposition: IntegrationDeliveryDispositionSchema,
|
|
319
|
+
}, { additionalProperties: false });
|
|
320
|
+
const PlatformOutboundTextContentSchema = Type.Object({
|
|
321
|
+
kind: Type.Literal("text"),
|
|
322
|
+
text: Type.String({ minLength: 1, maxLength: 4_000 }),
|
|
323
|
+
}, { additionalProperties: false });
|
|
324
|
+
const PlatformOutboundIntentFields = {
|
|
325
|
+
protocol_version: Type.Literal(1),
|
|
326
|
+
intent_ref: IdempotencyKeySchema,
|
|
327
|
+
relay_project_ref: RelayProjectRefSchema,
|
|
328
|
+
installation: PlatformInstallationLocatorSchema,
|
|
329
|
+
binding_ref: IntegrationOwnedRefSchema,
|
|
330
|
+
canonical_message_ref: MessageIdSchema,
|
|
331
|
+
trigger_message_ref: MessageIdSchema,
|
|
332
|
+
content: PlatformOutboundTextContentSchema,
|
|
333
|
+
created_at: IsoDateTimeStringSchema,
|
|
334
|
+
attempt: Type.Integer({ minimum: 1, maximum: 1_000_000 }),
|
|
335
|
+
};
|
|
336
|
+
export const PlatformOutboundTextIntentSchema = Type.Object(PlatformOutboundIntentFields, {
|
|
337
|
+
additionalProperties: false,
|
|
338
|
+
});
|
|
339
|
+
export const RelayAuthorizedPlatformOutboundTextIntentSchema = Type.Object({
|
|
340
|
+
...PlatformOutboundIntentFields,
|
|
341
|
+
conversation_ref: ExternalObjectRefSchema,
|
|
342
|
+
}, { additionalProperties: false });
|
|
343
|
+
export const IntegrationOutboundClaimRequestSchema = Type.Object({
|
|
344
|
+
protocol_version: Type.Literal(1),
|
|
345
|
+
installation: PlatformInstallationLocatorSchema,
|
|
346
|
+
}, { additionalProperties: false });
|
|
347
|
+
export const IntegrationOutboundClaimResponseSchema = Type.Union([
|
|
348
|
+
Type.Object({
|
|
349
|
+
protocol_version: Type.Literal(1),
|
|
350
|
+
disposition: Type.Object({
|
|
351
|
+
kind: Type.Literal("idle"),
|
|
352
|
+
retry_after_ms: Type.Integer({ minimum: 100, maximum: 60_000 }),
|
|
353
|
+
}, { additionalProperties: false }),
|
|
354
|
+
}, { additionalProperties: false }),
|
|
355
|
+
Type.Object({
|
|
356
|
+
protocol_version: Type.Literal(1),
|
|
357
|
+
disposition: Type.Object({
|
|
358
|
+
kind: Type.Literal("claimed"),
|
|
359
|
+
claim_ref: IntegrationOwnedRefSchema,
|
|
360
|
+
claim_expires_at: IsoDateTimeStringSchema,
|
|
361
|
+
intent: RelayAuthorizedPlatformOutboundTextIntentSchema,
|
|
362
|
+
}, { additionalProperties: false }),
|
|
363
|
+
}, { additionalProperties: false }),
|
|
364
|
+
]);
|
|
365
|
+
export const IntegrationOutboundAckDispositionSchema = Type.Union([
|
|
366
|
+
Type.Object({
|
|
367
|
+
kind: Type.Literal("accepted"),
|
|
368
|
+
delivery_ref: IntegrationOwnedRefSchema,
|
|
369
|
+
}, { additionalProperties: false }),
|
|
370
|
+
Type.Object({
|
|
371
|
+
kind: Type.Literal("duplicate"),
|
|
372
|
+
delivery_ref: IntegrationOwnedRefSchema,
|
|
373
|
+
}, { additionalProperties: false }),
|
|
374
|
+
Type.Object({
|
|
375
|
+
kind: Type.Literal("rejected"),
|
|
376
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
377
|
+
}, { additionalProperties: false }),
|
|
378
|
+
]);
|
|
379
|
+
export const IntegrationOutboundAckRequestSchema = Type.Object({
|
|
380
|
+
protocol_version: Type.Literal(1),
|
|
381
|
+
installation: PlatformInstallationLocatorSchema,
|
|
382
|
+
claim_ref: IntegrationOwnedRefSchema,
|
|
383
|
+
intent_ref: IdempotencyKeySchema,
|
|
384
|
+
disposition: IntegrationOutboundAckDispositionSchema,
|
|
385
|
+
}, { additionalProperties: false });
|
|
386
|
+
export const IntegrationOutboundAckResponseSchema = Type.Object({
|
|
387
|
+
protocol_version: Type.Literal(1),
|
|
388
|
+
disposition: Type.Union([
|
|
389
|
+
Type.Object({ kind: Type.Literal("acknowledged") }, { additionalProperties: false }),
|
|
390
|
+
Type.Object({
|
|
391
|
+
kind: Type.Literal("stale"),
|
|
392
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
393
|
+
}, { additionalProperties: false }),
|
|
394
|
+
]),
|
|
395
|
+
}, { additionalProperties: false });
|
|
396
|
+
export const PlatformOutboundHandoffDispositionSchema = Type.Union([
|
|
397
|
+
Type.Object({
|
|
398
|
+
kind: Type.Literal("accepted"),
|
|
399
|
+
delivery_ref: IntegrationOwnedRefSchema,
|
|
400
|
+
}, { additionalProperties: false }),
|
|
401
|
+
Type.Object({
|
|
402
|
+
kind: Type.Literal("duplicate"),
|
|
403
|
+
delivery_ref: IntegrationOwnedRefSchema,
|
|
404
|
+
}, { additionalProperties: false }),
|
|
405
|
+
Type.Object({
|
|
406
|
+
kind: Type.Literal("unavailable"),
|
|
407
|
+
retryable: Type.Literal(true),
|
|
408
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
409
|
+
}, { additionalProperties: false }),
|
|
410
|
+
Type.Object({
|
|
411
|
+
kind: Type.Union([
|
|
412
|
+
Type.Literal("invalid"),
|
|
413
|
+
Type.Literal("unauthorized"),
|
|
414
|
+
Type.Literal("unsupported"),
|
|
415
|
+
]),
|
|
416
|
+
reason_code: Type.String({ minLength: 1, maxLength: 128 }),
|
|
417
|
+
}, { additionalProperties: false }),
|
|
418
|
+
]);
|
|
419
|
+
export const PlatformOutboundHandoffResponseSchema = Type.Object({
|
|
420
|
+
protocol_version: Type.Literal(1),
|
|
421
|
+
disposition: PlatformOutboundHandoffDispositionSchema,
|
|
422
|
+
}, { additionalProperties: false });
|
|
423
|
+
function sameInstallation(left, right) {
|
|
424
|
+
return left.platform === right.platform && left.installation_ref === right.installation_ref;
|
|
425
|
+
}
|
|
426
|
+
export function isConversationIngestionEnvelope(value) {
|
|
427
|
+
if (!Value.Check(ConversationIngestionEnvelopeSchema, value)) {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
const envelope = value;
|
|
431
|
+
const locatorInstallation = envelope.kind === "conversation_source"
|
|
432
|
+
? envelope.source.locator.conversation.installation
|
|
433
|
+
: envelope.observation.locator.conversation.installation;
|
|
434
|
+
if (!sameInstallation(envelope.receipt.installation, envelope.actor.installation) ||
|
|
435
|
+
!sameInstallation(envelope.receipt.installation, locatorInstallation)) {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
return envelope.kind === "conversation_source"
|
|
439
|
+
? envelope.actor.purpose === "live_ingestion" || envelope.actor.purpose === "history_backfill"
|
|
440
|
+
: envelope.actor.purpose === "revision_observation" ||
|
|
441
|
+
envelope.actor.purpose === "history_backfill";
|
|
442
|
+
}
|
|
443
|
+
function sameExternalSubject(left, right) {
|
|
444
|
+
return (left.subject_kind === right.subject_kind &&
|
|
445
|
+
left.subject_ref === right.subject_ref &&
|
|
446
|
+
sameInstallation(left.installation, right.installation));
|
|
447
|
+
}
|
|
448
|
+
export function isIntegrationConversationSourceDeliveryRequest(value) {
|
|
449
|
+
if (!Value.Check(IntegrationConversationSourceDeliveryRequestSchema, value)) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
const request = value;
|
|
453
|
+
const sourceInstallation = request.source.locator.conversation.installation;
|
|
454
|
+
const sourceSubject = request.source.author.external_subject;
|
|
455
|
+
return (request.receipt.event_kind === "conversation_source" &&
|
|
456
|
+
sourceSubject.subject_kind === "human" &&
|
|
457
|
+
sameInstallation(request.receipt.installation, sourceInstallation) &&
|
|
458
|
+
sameInstallation(request.receipt.installation, sourceSubject.installation));
|
|
459
|
+
}
|
|
460
|
+
export function isIntegrationConversationBindingRequest(value) {
|
|
461
|
+
if (!Value.Check(IntegrationConversationBindingRequestSchema, value)) {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
return (value.installation.platform === "feishu" &&
|
|
465
|
+
value.external_subject.subject_kind === "human" &&
|
|
466
|
+
sameInstallation(value.installation, value.external_subject.installation));
|
|
467
|
+
}
|
|
468
|
+
export function isIntegrationConversationBindingResponse(value) {
|
|
469
|
+
return Value.Check(IntegrationConversationBindingResponseSchema, value);
|
|
470
|
+
}
|
|
471
|
+
export function isTrustedConversationSourceIngestionCommand(value) {
|
|
472
|
+
if (!Value.Check(TrustedConversationSourceIngestionCommandSchema, value)) {
|
|
473
|
+
return false;
|
|
474
|
+
}
|
|
475
|
+
const command = value;
|
|
476
|
+
const sourceInstallation = command.source.locator.conversation.installation;
|
|
477
|
+
const sourceAuthor = command.source.author;
|
|
478
|
+
return (command.receipt.event_kind === "conversation_source" &&
|
|
479
|
+
command.actor.membership.relay_project_ref === command.relay_project_ref &&
|
|
480
|
+
command.actor.binding_ref === command.binding_ref &&
|
|
481
|
+
command.actor.account_ref === sourceAuthor.account_ref &&
|
|
482
|
+
command.actor.display_name === sourceAuthor.display_name &&
|
|
483
|
+
sameExternalSubject(command.actor.external_subject, sourceAuthor.external_subject) &&
|
|
484
|
+
sameInstallation(command.receipt.installation, sourceInstallation) &&
|
|
485
|
+
sameInstallation(command.receipt.installation, sourceAuthor.external_subject.installation));
|
|
486
|
+
}
|
|
487
|
+
export function isIntegrationDeliveryTunnelMetadata(value) {
|
|
488
|
+
return Value.Check(IntegrationDeliveryTunnelMetadataSchema, value);
|
|
489
|
+
}
|
|
490
|
+
export function isIntegrationConversationSourceDeliveryResponse(value) {
|
|
491
|
+
return Value.Check(IntegrationConversationSourceDeliveryResponseSchema, value);
|
|
492
|
+
}
|
|
493
|
+
export function isPlatformOutboundTextIntent(value) {
|
|
494
|
+
return Value.Check(PlatformOutboundTextIntentSchema, value);
|
|
495
|
+
}
|
|
496
|
+
export function isRelayAuthorizedPlatformOutboundTextIntent(value) {
|
|
497
|
+
return Value.Check(RelayAuthorizedPlatformOutboundTextIntentSchema, value);
|
|
498
|
+
}
|
|
499
|
+
export function isIntegrationOutboundClaimRequest(value) {
|
|
500
|
+
return (Value.Check(IntegrationOutboundClaimRequestSchema, value) &&
|
|
501
|
+
value.installation.platform === "feishu");
|
|
502
|
+
}
|
|
503
|
+
export function isIntegrationOutboundClaimResponse(value) {
|
|
504
|
+
return Value.Check(IntegrationOutboundClaimResponseSchema, value);
|
|
505
|
+
}
|
|
506
|
+
export function isIntegrationOutboundAckRequest(value) {
|
|
507
|
+
return (Value.Check(IntegrationOutboundAckRequestSchema, value) &&
|
|
508
|
+
value.installation.platform === "feishu");
|
|
509
|
+
}
|
|
510
|
+
export function isIntegrationOutboundAckResponse(value) {
|
|
511
|
+
return Value.Check(IntegrationOutboundAckResponseSchema, value);
|
|
512
|
+
}
|
|
513
|
+
export function isPlatformOutboundHandoffResponse(value) {
|
|
514
|
+
return Value.Check(PlatformOutboundHandoffResponseSchema, value);
|
|
515
|
+
}
|
|
516
|
+
//# sourceMappingURL=platform-integration.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const FEISHU_DIAGNOSTIC_ID_HEADER = "x-tutti-feishu-diagnostic-id";
|
|
2
|
+
export declare const FEISHU_WEB_RELEASE_HEADER = "x-tutti-feishu-web-release";
|
|
3
|
+
export type FeishuRequestDiagnostics = {
|
|
4
|
+
diagnosticId: string;
|
|
5
|
+
webRelease: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function isFeishuDiagnosticId(value: unknown): value is string;
|
|
8
|
+
export declare function isFeishuWebRelease(value: unknown): value is string;
|
|
9
|
+
export declare function isFeishuRequestDiagnostics(value: unknown): value is FeishuRequestDiagnostics;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const FEISHU_DIAGNOSTIC_ID_HEADER = "x-tutti-feishu-diagnostic-id";
|
|
2
|
+
export const FEISHU_WEB_RELEASE_HEADER = "x-tutti-feishu-web-release";
|
|
3
|
+
const FEISHU_DIAGNOSTIC_ID_PATTERN = /^fdiag_[A-Za-z0-9_-]{16,64}$/u;
|
|
4
|
+
const FEISHU_WEB_RELEASE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u;
|
|
5
|
+
export function isFeishuDiagnosticId(value) {
|
|
6
|
+
return typeof value === "string" && FEISHU_DIAGNOSTIC_ID_PATTERN.test(value);
|
|
7
|
+
}
|
|
8
|
+
export function isFeishuWebRelease(value) {
|
|
9
|
+
return typeof value === "string" && FEISHU_WEB_RELEASE_PATTERN.test(value);
|
|
10
|
+
}
|
|
11
|
+
export function isFeishuRequestDiagnostics(value) {
|
|
12
|
+
return (typeof value === "object" &&
|
|
13
|
+
value !== null &&
|
|
14
|
+
"diagnosticId" in value &&
|
|
15
|
+
"webRelease" in value &&
|
|
16
|
+
isFeishuDiagnosticId(value.diagnosticId) &&
|
|
17
|
+
isFeishuWebRelease(value.webRelease));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -7,7 +7,7 @@ export declare const REDACTION_LABELS: {
|
|
|
7
7
|
readonly hostSecret: "[REDACTED:host_secret]";
|
|
8
8
|
readonly localPath: "[REDACTED:local_path]";
|
|
9
9
|
};
|
|
10
|
-
export declare const REDACTION_FIXTURES: readonly ["sk-proj-example-secret", "Authorization: Bearer example-token", "Cookie: tutti_session=example-session", "Cookie: tutti_preview_session=example-preview-session", "https://opaque.preview.tutti.now/__tutti_preview_bootstrap#token=example-preview-token", "http://127.0.0.1:4370/join/example-join-token", "http://127.0.0.1:4370/api/v1/join/example-join-token/accept", "http://127.0.0.1:4371/setup?token=example-runtime-token", "host_connection_token=example-host-token", "host_registration_secret=example-host-secret", "/Users/example/.tutti/auth.json", "/Users/example/project/.git/config", "/Users/example/.tutti/projects/proj_123/runs/act_123", "OPENAI_API_KEY=example"];
|
|
10
|
+
export declare const REDACTION_FIXTURES: readonly ["sk-proj-example-secret", "Authorization: Bearer example-token", "Cookie: tutti_session=example-session", "Cookie: tutti_preview_session=example-preview-session", "Cookie: tutti_feishu_session=example-feishu-session", "https://opaque.preview.tutti.now/__tutti_preview_bootstrap#token=example-preview-token", "http://127.0.0.1:4370/join/example-join-token", "http://127.0.0.1:4370/api/v1/join/example-join-token/accept", "http://127.0.0.1:4371/setup?token=example-runtime-token", "host_connection_token=example-host-token", "host_registration_secret=example-host-secret", "TUTTI_FEISHU_APP_SECRET=example-feishu-app-secret", "authorization_code=example-feishu-authorization-code", "app_access_token=example-feishu-app-token", "user_access_token=example-feishu-user-token", "refresh_token=example-feishu-refresh-token", "/Users/example/.tutti/auth.json", "/Users/example/project/.git/config", "/Users/example/.tutti/projects/proj_123/runs/act_123", "OPENAI_API_KEY=example"];
|
|
11
11
|
export declare function redactText(value: string): string;
|
|
12
12
|
export declare function redactValue(value: unknown): unknown;
|
|
13
13
|
export type RedactedError = {
|
|
@@ -12,12 +12,18 @@ export const REDACTION_FIXTURES = [
|
|
|
12
12
|
"Authorization: Bearer example-token",
|
|
13
13
|
"Cookie: tutti_session=example-session",
|
|
14
14
|
"Cookie: tutti_preview_session=example-preview-session",
|
|
15
|
+
"Cookie: tutti_feishu_session=example-feishu-session",
|
|
15
16
|
"https://opaque.preview.tutti.now/__tutti_preview_bootstrap#token=example-preview-token",
|
|
16
17
|
"http://127.0.0.1:4370/join/example-join-token",
|
|
17
18
|
"http://127.0.0.1:4370/api/v1/join/example-join-token/accept",
|
|
18
19
|
"http://127.0.0.1:4371/setup?token=example-runtime-token",
|
|
19
20
|
"host_connection_token=example-host-token",
|
|
20
21
|
"host_registration_secret=example-host-secret",
|
|
22
|
+
"TUTTI_FEISHU_APP_SECRET=example-feishu-app-secret",
|
|
23
|
+
"authorization_code=example-feishu-authorization-code",
|
|
24
|
+
"app_access_token=example-feishu-app-token",
|
|
25
|
+
"user_access_token=example-feishu-user-token",
|
|
26
|
+
"refresh_token=example-feishu-refresh-token",
|
|
21
27
|
"/Users/example/.tutti/auth.json",
|
|
22
28
|
"/Users/example/project/.git/config",
|
|
23
29
|
"/Users/example/.tutti/projects/proj_123/runs/act_123",
|
|
@@ -48,6 +54,10 @@ const TEXT_REDACTION_RULES = [
|
|
|
48
54
|
pattern: /\btutti_preview_session\s*=\s*[^;\s,]+/giu,
|
|
49
55
|
replacement: `tutti_preview_session=${REDACTION_LABELS.cookie}`,
|
|
50
56
|
},
|
|
57
|
+
{
|
|
58
|
+
pattern: /\btutti_feishu_session\s*=\s*[^;\s,]+/giu,
|
|
59
|
+
replacement: `tutti_feishu_session=${REDACTION_LABELS.cookie}`,
|
|
60
|
+
},
|
|
51
61
|
{
|
|
52
62
|
pattern: /(https?:\/\/[^\s"'`]+\/__tutti_preview_bootstrap)#token=[A-Za-z0-9._~+/%=-]+/giu,
|
|
53
63
|
replacement: `$1#token=${REDACTION_LABELS.bearerToken}`,
|
|
@@ -88,6 +98,14 @@ const TEXT_REDACTION_RULES = [
|
|
|
88
98
|
pattern: /\bhost_registration_secret\s*=\s*[^\s"'`&]+/giu,
|
|
89
99
|
replacement: `host_registration_secret=${REDACTION_LABELS.hostSecret}`,
|
|
90
100
|
},
|
|
101
|
+
{
|
|
102
|
+
pattern: /\bTUTTI_FEISHU_APP_SECRET\s*=\s*[^\s"'`&]+/giu,
|
|
103
|
+
replacement: `TUTTI_FEISHU_APP_SECRET=${REDACTION_LABELS.hostSecret}`,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
pattern: /\b(authorization_code|app_access_token|user_access_token|refresh_token)\s*=\s*[^\s"'`&,]+/giu,
|
|
107
|
+
replacement: `$1=${REDACTION_LABELS.bearerToken}`,
|
|
108
|
+
},
|
|
91
109
|
{
|
|
92
110
|
pattern: /\bsk-(?:proj-)?[A-Za-z0-9_-]{8,}\b/gu,
|
|
93
111
|
replacement: REDACTION_LABELS.providerApiKey,
|