@grackle-ai/core 0.82.2 → 0.83.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.
Files changed (103) hide show
  1. package/dist/codespace-handlers.d.ts +6 -0
  2. package/dist/codespace-handlers.d.ts.map +1 -0
  3. package/dist/codespace-handlers.js +66 -0
  4. package/dist/codespace-handlers.js.map +1 -0
  5. package/dist/cron-phase.d.ts +1 -1
  6. package/dist/cron-phase.d.ts.map +1 -1
  7. package/dist/cron-phase.js +1 -1
  8. package/dist/cron-phase.js.map +1 -1
  9. package/dist/environment-handlers.d.ts +16 -0
  10. package/dist/environment-handlers.d.ts.map +1 -0
  11. package/dist/environment-handlers.js +237 -0
  12. package/dist/environment-handlers.js.map +1 -0
  13. package/dist/event-bus.d.ts +1 -1
  14. package/dist/event-bus.d.ts.map +1 -1
  15. package/dist/event-bus.js.map +1 -1
  16. package/dist/event-hub.d.ts +29 -0
  17. package/dist/event-hub.d.ts.map +1 -0
  18. package/dist/event-hub.js +89 -0
  19. package/dist/event-hub.js.map +1 -0
  20. package/dist/finding-handlers.d.ts +6 -0
  21. package/dist/finding-handlers.d.ts.map +1 -0
  22. package/dist/finding-handlers.js +27 -0
  23. package/dist/finding-handlers.js.map +1 -0
  24. package/dist/grpc-mcp-config.d.ts +11 -0
  25. package/dist/grpc-mcp-config.d.ts.map +1 -0
  26. package/dist/grpc-mcp-config.js +29 -0
  27. package/dist/grpc-mcp-config.js.map +1 -0
  28. package/dist/grpc-proto-converters.d.ts +25 -0
  29. package/dist/grpc-proto-converters.d.ts.map +1 -0
  30. package/dist/grpc-proto-converters.js +193 -0
  31. package/dist/grpc-proto-converters.js.map +1 -0
  32. package/dist/grpc-service.d.ts +3 -19
  33. package/dist/grpc-service.d.ts.map +1 -1
  34. package/dist/grpc-service.js +28 -1989
  35. package/dist/grpc-service.js.map +1 -1
  36. package/dist/grpc-shared.d.ts +25 -0
  37. package/dist/grpc-shared.d.ts.map +1 -0
  38. package/dist/grpc-shared.js +110 -0
  39. package/dist/grpc-shared.js.map +1 -0
  40. package/dist/index.d.ts +4 -2
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +4 -3
  43. package/dist/index.js.map +1 -1
  44. package/dist/knowledge-handlers.d.ts +12 -0
  45. package/dist/knowledge-handlers.d.ts.map +1 -0
  46. package/dist/knowledge-handlers.js +85 -0
  47. package/dist/knowledge-handlers.js.map +1 -0
  48. package/dist/orphan-phase.d.ts +27 -0
  49. package/dist/orphan-phase.d.ts.map +1 -0
  50. package/dist/orphan-phase.js +69 -0
  51. package/dist/orphan-phase.js.map +1 -0
  52. package/dist/persona-handlers.d.ts +12 -0
  53. package/dist/persona-handlers.d.ts.map +1 -0
  54. package/dist/persona-handlers.js +148 -0
  55. package/dist/persona-handlers.js.map +1 -0
  56. package/dist/schedule-handlers.d.ts +12 -0
  57. package/dist/schedule-handlers.d.ts.map +1 -0
  58. package/dist/schedule-handlers.js +122 -0
  59. package/dist/schedule-handlers.js.map +1 -0
  60. package/dist/session-handlers.d.ts +34 -0
  61. package/dist/session-handlers.d.ts.map +1 -0
  62. package/dist/session-handlers.js +488 -0
  63. package/dist/session-handlers.js.map +1 -0
  64. package/dist/settings-handlers.d.ts +10 -0
  65. package/dist/settings-handlers.d.ts.map +1 -0
  66. package/dist/settings-handlers.js +68 -0
  67. package/dist/settings-handlers.js.map +1 -0
  68. package/dist/signals/orphan-reparent.d.ts +30 -0
  69. package/dist/signals/orphan-reparent.d.ts.map +1 -0
  70. package/dist/signals/orphan-reparent.js +179 -0
  71. package/dist/signals/orphan-reparent.js.map +1 -0
  72. package/dist/signals/sigchld.d.ts.map +1 -1
  73. package/dist/signals/sigchld.js +4 -8
  74. package/dist/signals/sigchld.js.map +1 -1
  75. package/dist/task-handlers.d.ts +22 -0
  76. package/dist/task-handlers.d.ts.map +1 -0
  77. package/dist/task-handlers.js +463 -0
  78. package/dist/task-handlers.js.map +1 -0
  79. package/dist/task-session.d.ts +26 -0
  80. package/dist/task-session.d.ts.map +1 -0
  81. package/dist/task-session.js +132 -0
  82. package/dist/task-session.js.map +1 -0
  83. package/dist/test-utils/mock-database.d.ts +2 -0
  84. package/dist/test-utils/mock-database.d.ts.map +1 -1
  85. package/dist/test-utils/mock-database.js +2 -0
  86. package/dist/test-utils/mock-database.js.map +1 -1
  87. package/dist/token-handlers.d.ts +12 -0
  88. package/dist/token-handlers.d.ts.map +1 -0
  89. package/dist/token-handlers.js +85 -0
  90. package/dist/token-handlers.js.map +1 -0
  91. package/dist/workspace-handlers.d.ts +12 -0
  92. package/dist/workspace-handlers.d.ts.map +1 -0
  93. package/dist/workspace-handlers.js +86 -0
  94. package/dist/workspace-handlers.js.map +1 -0
  95. package/package.json +7 -9
  96. package/dist/ws-bridge.d.ts +0 -30
  97. package/dist/ws-bridge.d.ts.map +0 -1
  98. package/dist/ws-bridge.js +0 -372
  99. package/dist/ws-bridge.js.map +0 -1
  100. package/dist/ws-broadcast.d.ts +0 -19
  101. package/dist/ws-broadcast.d.ts.map +0 -1
  102. package/dist/ws-broadcast.js +0 -60
  103. package/dist/ws-broadcast.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ import { logger } from "./logger.js";
2
+ /** Build a JSON string of MCP server configs for the PowerLine SpawnRequest. */
3
+ export function buildMcpServersJson(mcpServers) {
4
+ const obj = {};
5
+ for (const s of mcpServers) {
6
+ obj[s.name] = {
7
+ command: s.command,
8
+ args: s.args || [],
9
+ ...(s.tools && s.tools.length > 0 ? { tools: s.tools } : {}),
10
+ };
11
+ }
12
+ return JSON.stringify(obj);
13
+ }
14
+ /** Convert persona MCP server configs to a JSON string for the PowerLine SpawnRequest. */
15
+ export function personaMcpServersToJson(row) {
16
+ let mcpServers;
17
+ try {
18
+ mcpServers = JSON.parse(row.mcpServers || "[]");
19
+ }
20
+ catch {
21
+ logger.warn({ personaId: row.id }, "Failed to parse persona mcpServers JSON; ignoring");
22
+ return "";
23
+ }
24
+ if (!Array.isArray(mcpServers) || mcpServers.length === 0) {
25
+ return "";
26
+ }
27
+ return buildMcpServersJson(mcpServers);
28
+ }
29
+ //# sourceMappingURL=grpc-mcp-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grpc-mcp-config.js","sourceRoot":"","sources":["../src/grpc-mcp-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,gFAAgF;AAChF,MAAM,UAAU,mBAAmB,CACjC,UAKG;IAEH,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;YAClB,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,uBAAuB,CAAC,GAA4B;IAClE,IAAI,UAAkF,CAAC;IACvF,IAAI,CAAC;QACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAsB,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,mDAAmD,CAAC,CAAC;QACxF,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,mBAAmB,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { grackle } from "@grackle-ai/common";
2
+ import type { EnvironmentRow, SessionRow } from "@grackle-ai/database";
3
+ import { workspaceStore, taskStore, personaStore, findingStore, scheduleStore } from "@grackle-ai/database";
4
+ import type { KnowledgeNode, KnowledgeEdge } from "@grackle-ai/knowledge";
5
+ /** Convert an environment database row to its proto representation. */
6
+ export declare function envRowToProto(row: EnvironmentRow): grackle.Environment;
7
+ /** Convert a session database row to its proto representation. */
8
+ export declare function sessionRowToProto(row: SessionRow): grackle.Session;
9
+ /** Convert a workspace database row to its proto representation. */
10
+ export declare function workspaceRowToProto(row: workspaceStore.WorkspaceRow): grackle.Workspace;
11
+ /** Convert a task database row to its proto representation. */
12
+ export declare function taskRowToProto(row: taskStore.TaskRow, childIds?: string[], computedStatus?: string, latestSessionId?: string): grackle.Task;
13
+ /** Convert a schedule database row to its proto representation. */
14
+ export declare function scheduleRowToProto(row: scheduleStore.ScheduleRow): grackle.Schedule;
15
+ /** Convert a finding database row to its proto representation. */
16
+ export declare function findingRowToProto(row: findingStore.FindingRow): grackle.Finding;
17
+ /** Safely parse a JSON string, returning the fallback value on failure. */
18
+ export declare function safeParseJson<T>(value: string | undefined, fallback: T): T;
19
+ /** Convert a persona database row to a Persona proto message. */
20
+ export declare function personaRowToProto(row: personaStore.PersonaRow): grackle.Persona;
21
+ /** Convert a KnowledgeNode to its proto representation. */
22
+ export declare function knowledgeNodeToProto(node: KnowledgeNode): grackle.KnowledgeNodeProto;
23
+ /** Convert a KnowledgeEdge to its proto representation. */
24
+ export declare function knowledgeEdgeToProto(edge: KnowledgeEdge): grackle.KnowledgeEdgeProto;
25
+ //# sourceMappingURL=grpc-proto-converters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grpc-proto-converters.d.ts","sourceRoot":"","sources":["../src/grpc-proto-converters.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E;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAepF;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAQpF"}
@@ -0,0 +1,193 @@
1
+ import { create } from "@bufbuild/protobuf";
2
+ import { grackle } from "@grackle-ai/common";
3
+ import { workspaceStatusToEnum, taskStatusToEnum, } from "@grackle-ai/common";
4
+ import { taskStore, safeParseJsonArray } from "@grackle-ai/database";
5
+ /** Convert an environment database row to its proto representation. */
6
+ export function envRowToProto(row) {
7
+ return create(grackle.EnvironmentSchema, {
8
+ id: row.id,
9
+ displayName: row.displayName,
10
+ adapterType: row.adapterType,
11
+ adapterConfig: row.adapterConfig,
12
+ bootstrapped: row.bootstrapped,
13
+ status: row.status,
14
+ lastSeen: row.lastSeen || "",
15
+ envInfo: row.envInfo || "",
16
+ createdAt: row.createdAt,
17
+ });
18
+ }
19
+ /** Convert a session database row to its proto representation. */
20
+ export function sessionRowToProto(row) {
21
+ return create(grackle.SessionSchema, {
22
+ id: row.id,
23
+ environmentId: row.environmentId,
24
+ runtime: row.runtime,
25
+ runtimeSessionId: row.runtimeSessionId ?? "",
26
+ prompt: row.prompt,
27
+ model: row.model,
28
+ status: row.status,
29
+ logPath: row.logPath ?? "",
30
+ turns: row.turns,
31
+ startedAt: row.startedAt,
32
+ suspendedAt: row.suspendedAt ?? "",
33
+ endedAt: row.endedAt ?? "",
34
+ error: row.error ?? "",
35
+ taskId: row.taskId,
36
+ personaId: row.personaId,
37
+ inputTokens: row.inputTokens,
38
+ outputTokens: row.outputTokens,
39
+ costUsd: row.costUsd,
40
+ endReason: row.endReason ?? "",
41
+ });
42
+ }
43
+ /** Convert a workspace database row to its proto representation. */
44
+ export function workspaceRowToProto(row) {
45
+ return create(grackle.WorkspaceSchema, {
46
+ id: row.id,
47
+ name: row.name,
48
+ description: row.description,
49
+ repoUrl: row.repoUrl,
50
+ environmentId: row.environmentId,
51
+ status: workspaceStatusToEnum(row.status),
52
+ createdAt: row.createdAt,
53
+ updatedAt: row.updatedAt,
54
+ useWorktrees: row.useWorktrees,
55
+ workingDirectory: row.workingDirectory,
56
+ defaultPersonaId: row.defaultPersonaId,
57
+ });
58
+ }
59
+ /** Convert a task database row to its proto representation. */
60
+ export function taskRowToProto(row, childIds, computedStatus, latestSessionId) {
61
+ return create(grackle.TaskSchema, {
62
+ id: row.id,
63
+ workspaceId: row.workspaceId ?? undefined,
64
+ title: row.title,
65
+ description: row.description,
66
+ status: taskStatusToEnum(computedStatus ?? row.status),
67
+ branch: row.branch,
68
+ latestSessionId: latestSessionId ?? "",
69
+ dependsOn: safeParseJsonArray(row.dependsOn),
70
+ startedAt: row.startedAt ?? "",
71
+ completedAt: row.completedAt ?? "",
72
+ createdAt: row.createdAt,
73
+ updatedAt: row.updatedAt,
74
+ sortOrder: row.sortOrder,
75
+ parentTaskId: row.parentTaskId,
76
+ depth: row.depth,
77
+ childTaskIds: childIds ?? taskStore.getChildren(row.id).map((c) => c.id),
78
+ canDecompose: row.canDecompose,
79
+ defaultPersonaId: row.defaultPersonaId,
80
+ workpad: row.workpad,
81
+ scheduleId: row.scheduleId,
82
+ });
83
+ }
84
+ /** Convert a schedule database row to its proto representation. */
85
+ export function scheduleRowToProto(row) {
86
+ return create(grackle.ScheduleSchema, {
87
+ id: row.id,
88
+ title: row.title,
89
+ description: row.description,
90
+ scheduleExpression: row.scheduleExpression,
91
+ personaId: row.personaId,
92
+ environmentId: row.environmentId,
93
+ workspaceId: row.workspaceId,
94
+ parentTaskId: row.parentTaskId,
95
+ enabled: row.enabled,
96
+ lastRunAt: row.lastRunAt ?? "",
97
+ nextRunAt: row.nextRunAt ?? "",
98
+ runCount: row.runCount,
99
+ createdAt: row.createdAt,
100
+ updatedAt: row.updatedAt,
101
+ });
102
+ }
103
+ /** Convert a finding database row to its proto representation. */
104
+ export function findingRowToProto(row) {
105
+ return create(grackle.FindingSchema, {
106
+ ...row,
107
+ tags: safeParseJsonArray(row.tags),
108
+ });
109
+ }
110
+ /** Safely parse a JSON string, returning the fallback value on failure. */
111
+ export function safeParseJson(value, fallback) {
112
+ if (!value) {
113
+ return fallback;
114
+ }
115
+ try {
116
+ return JSON.parse(value);
117
+ }
118
+ catch {
119
+ return fallback;
120
+ }
121
+ }
122
+ /** Convert a persona database row to a Persona proto message. */
123
+ export function personaRowToProto(row) {
124
+ const toolConfig = safeParseJson(row.toolConfig, {});
125
+ const mcpServers = safeParseJson(row.mcpServers, []);
126
+ return create(grackle.PersonaSchema, {
127
+ id: row.id,
128
+ name: row.name,
129
+ description: row.description,
130
+ systemPrompt: row.systemPrompt,
131
+ toolConfig: create(grackle.ToolConfigSchema, {
132
+ allowedTools: Array.isArray(toolConfig.allowedTools)
133
+ ? toolConfig.allowedTools.filter((t) => typeof t === "string")
134
+ : [],
135
+ disallowedTools: Array.isArray(toolConfig.disallowedTools)
136
+ ? toolConfig.disallowedTools.filter((t) => typeof t === "string")
137
+ : [],
138
+ }),
139
+ runtime: row.runtime,
140
+ model: row.model,
141
+ maxTurns: row.maxTurns,
142
+ mcpServers: mcpServers
143
+ .filter((s) =>
144
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- typeof null === "object", JSON.parse can return null
145
+ s !== null &&
146
+ typeof s === "object" &&
147
+ typeof s.name === "string" &&
148
+ typeof s.command === "string")
149
+ .map((s) => create(grackle.McpServerConfigSchema, {
150
+ name: s.name,
151
+ command: s.command,
152
+ args: Array.isArray(s.args)
153
+ ? s.args.filter((a) => typeof a === "string")
154
+ : [],
155
+ tools: Array.isArray(s.tools)
156
+ ? s.tools.filter((t) => typeof t === "string")
157
+ : [],
158
+ })),
159
+ createdAt: row.createdAt,
160
+ updatedAt: row.updatedAt,
161
+ type: row.type || "agent",
162
+ script: row.script || "",
163
+ allowedMcpTools: safeParseJson(row.allowedMcpTools, []).filter((t) => typeof t === "string"),
164
+ });
165
+ }
166
+ /** Convert a KnowledgeNode to its proto representation. */
167
+ export function knowledgeNodeToProto(node) {
168
+ return create(grackle.KnowledgeNodeProtoSchema, {
169
+ id: node.id,
170
+ kind: node.kind,
171
+ workspaceId: node.workspaceId,
172
+ createdAt: node.createdAt,
173
+ updatedAt: node.updatedAt,
174
+ sourceType: node.kind === "reference" ? node.sourceType : "",
175
+ sourceId: node.kind === "reference" ? node.sourceId : "",
176
+ label: node.kind === "reference" ? node.label : "",
177
+ category: node.kind === "native" ? node.category : "",
178
+ title: node.kind === "native" ? node.title : "",
179
+ content: node.kind === "native" ? node.content : "",
180
+ tags: node.kind === "native" ? node.tags : [],
181
+ });
182
+ }
183
+ /** Convert a KnowledgeEdge to its proto representation. */
184
+ export function knowledgeEdgeToProto(edge) {
185
+ return create(grackle.KnowledgeEdgeProtoSchema, {
186
+ fromId: edge.fromId,
187
+ toId: edge.toId,
188
+ type: edge.type,
189
+ metadataJson: edge.metadata ? JSON.stringify(edge.metadata) : "",
190
+ createdAt: edge.createdAt,
191
+ });
192
+ }
193
+ //# sourceMappingURL=grpc-proto-converters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grpc-proto-converters.js","sourceRoot":"","sources":["../src/grpc-proto-converters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAkB,SAAS,EAA6C,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGhI,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,GAAmB;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE;QACvC,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,WAAW,EAAE,GAAG,CA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AAM;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;QAChE,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CAAC;AACL,CAAC"}
@@ -1,22 +1,6 @@
1
- import { type ConnectRouter } from "@connectrpc/connect";
2
- /**
3
- * Map a bind host to a dialable URL host. Wildcard addresses become loopback,
4
- * unless GRACKLE_DOCKER_HOST is set (DooD mode) — in that case, use that value
5
- * so sibling containers can reach the server by container name.
6
- */
7
- export declare function toDialableHost(bindHost: string): string;
8
- /** Build a JSON string of MCP server configs for the PowerLine SpawnRequest. */
9
- export declare function buildMcpServersJson(mcpServers: {
10
- name: string;
11
- command: string;
12
- args?: string[];
13
- tools?: string[];
14
- }[]): string;
15
- /**
16
- * Walk up the task parent chain and return the environmentId from the first
17
- * ancestor that has a session. Returns empty string if no ancestor has one.
18
- */
19
- export declare function resolveAncestorEnvironmentId(parentTaskId: string): string;
1
+ import type { ConnectRouter } from "@connectrpc/connect";
2
+ export { toDialableHost, resolveAncestorEnvironmentId } from "./grpc-shared.js";
3
+ export { buildMcpServersJson } from "./grpc-mcp-config.js";
20
4
  /** Register all Grackle gRPC service handlers on the given ConnectRPC router. */
21
5
  export declare function registerGrackleRoutes(router: ConnectRouter): void;
22
6
  //# sourceMappingURL=grpc-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-service.d.ts","sourceRoot":"","sources":["../src/grpc-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAkG7E;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYvD;AA8MD,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,UAAU,EAAE;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,EAAE,GACF,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAczE;AAgDD,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAwhEjE"}
1
+ {"version":3,"file":"grpc-service.d.ts","sourceRoot":"","sources":["../src/grpc-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAiBzD,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAcjE"}