@atolis-hq/wake 0.4.75 → 0.4.76
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActivityOutcomeKind } from '../activities/index.js';
|
|
2
|
-
import { DeliveryState, IntegrationStreamKind, } from '../integrations/index.js';
|
|
2
|
+
import { deliveryProjectionKey, DeliveryState, IntegrationStreamKind, } from '../integrations/index.js';
|
|
3
3
|
import { workflowInstanceId } from '../orchestration/index.js';
|
|
4
4
|
export async function withWorkflowContext(root, run) {
|
|
5
5
|
const instance = await root.orchestration.get(workflowInstanceId(run.workflowInstanceId));
|
|
@@ -20,7 +20,7 @@ export async function withDeliveryResolution(root, run) {
|
|
|
20
20
|
const intentEventId = waitingDeliveryIntentEventId(run);
|
|
21
21
|
if (intentEventId === undefined)
|
|
22
22
|
return run;
|
|
23
|
-
const stored = await root.projections.read(IntegrationStreamKind.Delivery, intentEventId);
|
|
23
|
+
const stored = await root.projections.read(IntegrationStreamKind.Delivery, deliveryProjectionKey(intentEventId));
|
|
24
24
|
const delivery = stored?.value;
|
|
25
25
|
if (delivery === undefined || delivery.resolvedAt === undefined)
|
|
26
26
|
return run;
|
|
@@ -124,6 +124,6 @@ export function resolveWakeVersion(options = {}) {
|
|
|
124
124
|
return `g${headHash.slice(0, 7)}`;
|
|
125
125
|
return '0.1.0-dev';
|
|
126
126
|
}
|
|
127
|
-
export const wakeVersion = "v0.4.
|
|
127
|
+
export const wakeVersion = "v0.4.76";
|
|
128
128
|
/** The registry-installable version used by packaged sandbox images. */
|
|
129
129
|
export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type EventEnvelope, type ProjectionDefinition } from '@atolis-hq/eventing';
|
|
2
2
|
import type { DeliveryIntentView } from '../contracts/views.js';
|
|
3
3
|
export declare function projectDeliveries(events: readonly EventEnvelope[]): readonly DeliveryIntentView[];
|
|
4
|
+
/**
|
|
5
|
+
* Intent event ids can contain path separators (GitHub comment ids embed owner/repo), which the
|
|
6
|
+
* filesystem projection store rejects. Encode only those, so existing stored keys stay valid.
|
|
7
|
+
*/
|
|
8
|
+
export declare function deliveryProjectionKey(eventId: string): string;
|
|
4
9
|
export declare const deliveryProjection: ProjectionDefinition<DeliveryIntentView | null>;
|
|
5
10
|
export declare const deliveryProjectionDefinitions: readonly ProjectionDefinition[];
|
|
@@ -18,14 +18,21 @@ export function projectDeliveries(events) {
|
|
|
18
18
|
view.escalation === undefined)
|
|
19
19
|
.sort((left, right) => left.globalPosition - right.globalPosition);
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Intent event ids can contain path separators (GitHub comment ids embed owner/repo), which the
|
|
23
|
+
* filesystem projection store rejects. Encode only those, so existing stored keys stay valid.
|
|
24
|
+
*/
|
|
25
|
+
export function deliveryProjectionKey(eventId) {
|
|
26
|
+
return /[\\/]/.test(eventId) ? `encoded:${encodeURIComponent(eventId)}` : eventId;
|
|
27
|
+
}
|
|
21
28
|
export const deliveryProjection = {
|
|
22
29
|
name: IntegrationStreamKind.Delivery,
|
|
23
30
|
select(event) {
|
|
24
31
|
const intent = intentView(event);
|
|
25
32
|
if (intent !== null)
|
|
26
|
-
return { key: intent.eventId };
|
|
33
|
+
return { key: deliveryProjectionKey(intent.eventId) };
|
|
27
34
|
const delivery = selectDeliveryEvent(event);
|
|
28
|
-
return delivery === null ? null : { key: delivery.stream.id };
|
|
35
|
+
return delivery === null ? null : { key: deliveryProjectionKey(delivery.stream.id) };
|
|
29
36
|
},
|
|
30
37
|
initial: () => null,
|
|
31
38
|
project(previous, event) {
|