replicas-engine 0.1.141 → 0.1.143

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,252 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ fromUtf8,
4
+ toUtf8
5
+ } from "./chunk-ERL3EC7G.js";
6
+
7
+ // ../node_modules/.bun/@smithy+core@3.23.17/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js
8
+ var EventStreamSerde = class {
9
+ marshaller;
10
+ serializer;
11
+ deserializer;
12
+ serdeContext;
13
+ defaultContentType;
14
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) {
15
+ this.marshaller = marshaller;
16
+ this.serializer = serializer;
17
+ this.deserializer = deserializer;
18
+ this.serdeContext = serdeContext;
19
+ this.defaultContentType = defaultContentType;
20
+ }
21
+ async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
22
+ const marshaller = this.marshaller;
23
+ const eventStreamMember = requestSchema.getEventStreamMember();
24
+ const unionSchema = requestSchema.getMemberSchema(eventStreamMember);
25
+ const serializer = this.serializer;
26
+ const defaultContentType = this.defaultContentType;
27
+ const initialRequestMarker = /* @__PURE__ */ Symbol("initialRequestMarker");
28
+ const eventStreamIterable = {
29
+ async *[Symbol.asyncIterator]() {
30
+ if (initialRequest) {
31
+ const headers = {
32
+ ":event-type": { type: "string", value: "initial-request" },
33
+ ":message-type": { type: "string", value: "event" },
34
+ ":content-type": { type: "string", value: defaultContentType }
35
+ };
36
+ serializer.write(requestSchema, initialRequest);
37
+ const body = serializer.flush();
38
+ yield {
39
+ [initialRequestMarker]: true,
40
+ headers,
41
+ body
42
+ };
43
+ }
44
+ for await (const page of eventStream) {
45
+ yield page;
46
+ }
47
+ }
48
+ };
49
+ return marshaller.serialize(eventStreamIterable, (event) => {
50
+ if (event[initialRequestMarker]) {
51
+ return {
52
+ headers: event.headers,
53
+ body: event.body
54
+ };
55
+ }
56
+ let unionMember = "";
57
+ for (const key in event) {
58
+ if (key !== "__type") {
59
+ unionMember = key;
60
+ break;
61
+ }
62
+ }
63
+ const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);
64
+ const headers = {
65
+ ":event-type": { type: "string", value: eventType },
66
+ ":message-type": { type: "string", value: "event" },
67
+ ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType },
68
+ ...additionalHeaders
69
+ };
70
+ return {
71
+ headers,
72
+ body
73
+ };
74
+ });
75
+ }
76
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
77
+ const marshaller = this.marshaller;
78
+ const eventStreamMember = responseSchema.getEventStreamMember();
79
+ const unionSchema = responseSchema.getMemberSchema(eventStreamMember);
80
+ const memberSchemas = unionSchema.getMemberSchemas();
81
+ const initialResponseMarker = /* @__PURE__ */ Symbol("initialResponseMarker");
82
+ const asyncIterable = marshaller.deserialize(response.body, async (event) => {
83
+ let unionMember = "";
84
+ for (const key in event) {
85
+ if (key !== "__type") {
86
+ unionMember = key;
87
+ break;
88
+ }
89
+ }
90
+ const body = event[unionMember].body;
91
+ if (unionMember === "initial-response") {
92
+ const dataObject = await this.deserializer.read(responseSchema, body);
93
+ delete dataObject[eventStreamMember];
94
+ return {
95
+ [initialResponseMarker]: true,
96
+ ...dataObject
97
+ };
98
+ } else if (unionMember in memberSchemas) {
99
+ const eventStreamSchema = memberSchemas[unionMember];
100
+ if (eventStreamSchema.isStructSchema()) {
101
+ const out = {};
102
+ let hasBindings = false;
103
+ for (const [name, member] of eventStreamSchema.structIterator()) {
104
+ const { eventHeader, eventPayload } = member.getMergedTraits();
105
+ hasBindings = hasBindings || Boolean(eventHeader || eventPayload);
106
+ if (eventPayload) {
107
+ if (member.isBlobSchema()) {
108
+ out[name] = body;
109
+ } else if (member.isStringSchema()) {
110
+ out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);
111
+ } else if (member.isStructSchema()) {
112
+ out[name] = await this.deserializer.read(member, body);
113
+ }
114
+ } else if (eventHeader) {
115
+ const value = event[unionMember].headers[name]?.value;
116
+ if (value != null) {
117
+ if (member.isNumericSchema()) {
118
+ if (value && typeof value === "object" && "bytes" in value) {
119
+ out[name] = BigInt(value.toString());
120
+ } else {
121
+ out[name] = Number(value);
122
+ }
123
+ } else {
124
+ out[name] = value;
125
+ }
126
+ }
127
+ }
128
+ }
129
+ if (hasBindings) {
130
+ return {
131
+ [unionMember]: out
132
+ };
133
+ }
134
+ if (body.byteLength === 0) {
135
+ return {
136
+ [unionMember]: {}
137
+ };
138
+ }
139
+ }
140
+ return {
141
+ [unionMember]: await this.deserializer.read(eventStreamSchema, body)
142
+ };
143
+ } else {
144
+ return {
145
+ $unknown: event
146
+ };
147
+ }
148
+ });
149
+ const asyncIterator = asyncIterable[Symbol.asyncIterator]();
150
+ const firstEvent = await asyncIterator.next();
151
+ if (firstEvent.done) {
152
+ return asyncIterable;
153
+ }
154
+ if (firstEvent.value?.[initialResponseMarker]) {
155
+ if (!responseSchema) {
156
+ throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
157
+ }
158
+ for (const key in firstEvent.value) {
159
+ initialResponseContainer[key] = firstEvent.value[key];
160
+ }
161
+ }
162
+ return {
163
+ async *[Symbol.asyncIterator]() {
164
+ if (!firstEvent?.value?.[initialResponseMarker]) {
165
+ yield firstEvent.value;
166
+ }
167
+ while (true) {
168
+ const { done, value } = await asyncIterator.next();
169
+ if (done) {
170
+ break;
171
+ }
172
+ yield value;
173
+ }
174
+ }
175
+ };
176
+ }
177
+ writeEventBody(unionMember, unionSchema, event) {
178
+ const serializer = this.serializer;
179
+ let eventType = unionMember;
180
+ let explicitPayloadMember = null;
181
+ let explicitPayloadContentType;
182
+ const isKnownSchema = (() => {
183
+ const struct = unionSchema.getSchema();
184
+ return struct[4].includes(unionMember);
185
+ })();
186
+ const additionalHeaders = {};
187
+ if (!isKnownSchema) {
188
+ const [type, value] = event[unionMember];
189
+ eventType = type;
190
+ serializer.write(15, value);
191
+ } else {
192
+ const eventSchema = unionSchema.getMemberSchema(unionMember);
193
+ if (eventSchema.isStructSchema()) {
194
+ for (const [memberName, memberSchema] of eventSchema.structIterator()) {
195
+ const { eventHeader, eventPayload } = memberSchema.getMergedTraits();
196
+ if (eventPayload) {
197
+ explicitPayloadMember = memberName;
198
+ } else if (eventHeader) {
199
+ const value = event[unionMember][memberName];
200
+ let type = "binary";
201
+ if (memberSchema.isNumericSchema()) {
202
+ if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {
203
+ type = "integer";
204
+ } else {
205
+ type = "long";
206
+ }
207
+ } else if (memberSchema.isTimestampSchema()) {
208
+ type = "timestamp";
209
+ } else if (memberSchema.isStringSchema()) {
210
+ type = "string";
211
+ } else if (memberSchema.isBooleanSchema()) {
212
+ type = "boolean";
213
+ }
214
+ if (value != null) {
215
+ additionalHeaders[memberName] = {
216
+ type,
217
+ value
218
+ };
219
+ delete event[unionMember][memberName];
220
+ }
221
+ }
222
+ }
223
+ if (explicitPayloadMember !== null) {
224
+ const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);
225
+ if (payloadSchema.isBlobSchema()) {
226
+ explicitPayloadContentType = "application/octet-stream";
227
+ } else if (payloadSchema.isStringSchema()) {
228
+ explicitPayloadContentType = "text/plain";
229
+ }
230
+ serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);
231
+ } else {
232
+ serializer.write(eventSchema, event[unionMember]);
233
+ }
234
+ } else if (eventSchema.isUnitSchema()) {
235
+ serializer.write(eventSchema, {});
236
+ } else {
237
+ throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");
238
+ }
239
+ }
240
+ const messageSerialization = serializer.flush() ?? new Uint8Array();
241
+ const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization) : messageSerialization;
242
+ return {
243
+ body,
244
+ eventType,
245
+ explicitPayloadContentType,
246
+ additionalHeaders
247
+ };
248
+ }
249
+ };
250
+ export {
251
+ EventStreamSerde
252
+ };
package/dist/src/index.js CHANGED
@@ -978,10 +978,10 @@ var PLANS = {
978
978
  name: "Hobby",
979
979
  monthlyPrice: 0,
980
980
  seatPriceCents: 0,
981
- creditsIncluded: 20,
981
+ creditsIncluded: 1200,
982
982
  features: [
983
- "20 hours of human-initiated workspace usage (one-time)",
984
- "20 hours of API + automation usage (one-time)",
983
+ "1,200 minutes of human-initiated workspace usage (one-time)",
984
+ "1,200 minutes of API + automation usage (one-time)",
985
985
  "Automations (limited to 2)",
986
986
  "Warm pools and warm hooks",
987
987
  "Up to 3 repositories"
@@ -1170,7 +1170,7 @@ function parseReplicasConfigString(content, filename) {
1170
1170
  }
1171
1171
 
1172
1172
  // ../shared/src/engine/environment.ts
1173
- var DAYTONA_SNAPSHOT_ID = "04-05-2026-royal-york-v3";
1173
+ var DAYTONA_SNAPSHOT_ID = "06-05-2026-royal-york-v2";
1174
1174
 
1175
1175
  // ../shared/src/engine/types.ts
1176
1176
  var DEFAULT_CHAT_TITLES = {
@@ -1200,6 +1200,14 @@ function isReservedMcpName(name) {
1200
1200
  return RESERVED_MCP_NAME_PREFIXES.some((prefix) => name.startsWith(prefix));
1201
1201
  }
1202
1202
 
1203
+ // ../shared/src/object-store/types.ts
1204
+ var MEDIA_KIND = {
1205
+ IMAGE: "image",
1206
+ VIDEO: "video",
1207
+ AUDIO: "audio"
1208
+ };
1209
+ var MEDIA_KINDS = [MEDIA_KIND.IMAGE, MEDIA_KIND.VIDEO, MEDIA_KIND.AUDIO];
1210
+
1203
1211
  // src/services/environment-details-service.ts
1204
1212
  import { mkdir as mkdir3, readFile as readFile2, writeFile as writeFile3 } from "fs/promises";
1205
1213
  import { existsSync as existsSync3 } from "fs";