@orgloop/sdk 0.1.0
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/LICENSE.md +21 -0
- package/dist/connector.d.ts +174 -0
- package/dist/connector.d.ts.map +1 -0
- package/dist/connector.js +8 -0
- package/dist/connector.js.map +1 -0
- package/dist/event.d.ts +43 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +87 -0
- package/dist/event.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +40 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +8 -0
- package/dist/logger.js.map +1 -0
- package/dist/module.d.ts +214 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +125 -0
- package/dist/module.js.map +1 -0
- package/dist/testing.d.ts +104 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +188 -0
- package/dist/testing.js.map +1 -0
- package/dist/transform.d.ts +50 -0
- package/dist/transform.d.ts.map +1 -0
- package/dist/transform.js +8 -0
- package/dist/transform.js.map +1 -0
- package/dist/types.d.ts +299 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +30 -0
- package/dist/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform interface — the contract for event pipeline steps.
|
|
3
|
+
*
|
|
4
|
+
* Transforms modify, filter, or enrich events as they flow through routes.
|
|
5
|
+
* Two modes: script transforms (shell scripts) and package transforms (TypeScript).
|
|
6
|
+
*/
|
|
7
|
+
import type { OrgLoopEvent } from './types.js';
|
|
8
|
+
/** Context provided to transforms during execution */
|
|
9
|
+
export interface TransformContext {
|
|
10
|
+
/** Source connector ID */
|
|
11
|
+
source: string;
|
|
12
|
+
/** Target actor ID */
|
|
13
|
+
target: string;
|
|
14
|
+
/** Event type string */
|
|
15
|
+
eventType: string;
|
|
16
|
+
/** Route name */
|
|
17
|
+
routeName: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Transform interface (package transforms).
|
|
21
|
+
*
|
|
22
|
+
* Implement this for complex/reusable transforms.
|
|
23
|
+
* For simple filtering, prefer script transforms (shell scripts).
|
|
24
|
+
*/
|
|
25
|
+
export interface Transform {
|
|
26
|
+
/** Unique transform ID */
|
|
27
|
+
readonly id: string;
|
|
28
|
+
/** Initialize with config */
|
|
29
|
+
init(config: Record<string, unknown>): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Process an event.
|
|
32
|
+
* Return the (optionally modified) event to continue.
|
|
33
|
+
* Return null to filter/drop the event.
|
|
34
|
+
*/
|
|
35
|
+
execute(event: OrgLoopEvent, context: TransformContext): Promise<OrgLoopEvent | null>;
|
|
36
|
+
/** Clean shutdown */
|
|
37
|
+
shutdown(): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Transform registration — what a transform package exports.
|
|
41
|
+
*/
|
|
42
|
+
export interface TransformRegistration {
|
|
43
|
+
/** Unique transform ID */
|
|
44
|
+
id: string;
|
|
45
|
+
/** Transform class */
|
|
46
|
+
transform: new () => Transform;
|
|
47
|
+
/** JSON Schema for config validation */
|
|
48
|
+
configSchema?: Record<string, unknown>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAChC,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACzB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,6BAA6B;IAC7B,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAEtF,qBAAqB;IACrB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,SAAS,EAAE,UAAU,SAAS,CAAC;IAC/B,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform interface — the contract for event pipeline steps.
|
|
3
|
+
*
|
|
4
|
+
* Transforms modify, filter, or enrich events as they flow through routes.
|
|
5
|
+
* Two modes: script transforms (shell scripts) and package transforms (TypeScript).
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for OrgLoop.
|
|
3
|
+
*
|
|
4
|
+
* These types are the foundation of the system — every connector, transform,
|
|
5
|
+
* logger, and the core engine depend on them.
|
|
6
|
+
*/
|
|
7
|
+
/** OaC event types — the canonical set of event categories */
|
|
8
|
+
export type OrgLoopEventType = 'resource.changed' | 'actor.stopped' | 'message.received';
|
|
9
|
+
/** Author type classification */
|
|
10
|
+
export type AuthorType = 'team_member' | 'external' | 'bot' | 'system' | 'unknown';
|
|
11
|
+
/** Event provenance — where did this event come from? */
|
|
12
|
+
export interface EventProvenance {
|
|
13
|
+
/** Source platform identifier (e.g., "github", "linear") */
|
|
14
|
+
platform: string;
|
|
15
|
+
/** Platform-specific event type (e.g., "pull_request.review_submitted") */
|
|
16
|
+
platform_event?: string;
|
|
17
|
+
/** Author identifier */
|
|
18
|
+
author?: string;
|
|
19
|
+
/** Author classification */
|
|
20
|
+
author_type?: AuthorType;
|
|
21
|
+
/** Additional platform-specific provenance data */
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/** The canonical OrgLoop event — every event in the system conforms to this shape */
|
|
25
|
+
export interface OrgLoopEvent {
|
|
26
|
+
/** Unique event identifier (format: evt_*) */
|
|
27
|
+
id: string;
|
|
28
|
+
/** ISO 8601 timestamp (UTC) */
|
|
29
|
+
timestamp: string;
|
|
30
|
+
/** Source connector ID that emitted this event */
|
|
31
|
+
source: string;
|
|
32
|
+
/** OaC event type */
|
|
33
|
+
type: OrgLoopEventType;
|
|
34
|
+
/** Event provenance — platform, author, context */
|
|
35
|
+
provenance: EventProvenance;
|
|
36
|
+
/** Source-specific event payload */
|
|
37
|
+
payload: Record<string, unknown>;
|
|
38
|
+
/** Trace ID grouping all pipeline entries for this event */
|
|
39
|
+
trace_id?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Source connector configuration */
|
|
42
|
+
export interface SourceConfig {
|
|
43
|
+
/** Source ID assigned in the project config */
|
|
44
|
+
id: string;
|
|
45
|
+
/** Reference to the connector package */
|
|
46
|
+
connector: string;
|
|
47
|
+
/** Connector-specific configuration */
|
|
48
|
+
config: Record<string, unknown>;
|
|
49
|
+
/** Polling configuration */
|
|
50
|
+
poll?: PollConfig;
|
|
51
|
+
}
|
|
52
|
+
/** Polling configuration for source connectors */
|
|
53
|
+
export interface PollConfig {
|
|
54
|
+
/** Poll interval (e.g., "5m", "30s", "1h") */
|
|
55
|
+
interval: string;
|
|
56
|
+
}
|
|
57
|
+
/** Actor (target) connector configuration */
|
|
58
|
+
export interface ActorConfig {
|
|
59
|
+
/** Actor ID assigned in the project config */
|
|
60
|
+
id: string;
|
|
61
|
+
/** Reference to the connector package */
|
|
62
|
+
connector: string;
|
|
63
|
+
/** Connector-specific configuration */
|
|
64
|
+
config: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/** Route definition — when/then/with wiring */
|
|
67
|
+
export interface RouteDefinition {
|
|
68
|
+
/** Route name (unique within a route group) */
|
|
69
|
+
name: string;
|
|
70
|
+
/** Human-readable description */
|
|
71
|
+
description?: string;
|
|
72
|
+
/** Trigger: when should this route fire? */
|
|
73
|
+
when: RouteWhen;
|
|
74
|
+
/** Transform pipeline to apply before delivery */
|
|
75
|
+
transforms?: RouteTransformRef[];
|
|
76
|
+
/** Target: where to deliver the event */
|
|
77
|
+
then: RouteThen;
|
|
78
|
+
/** Launch context: situational instructions */
|
|
79
|
+
with?: RouteWith;
|
|
80
|
+
}
|
|
81
|
+
/** Route trigger definition */
|
|
82
|
+
export interface RouteWhen {
|
|
83
|
+
/** Source ID to match */
|
|
84
|
+
source: string;
|
|
85
|
+
/** Event types to match */
|
|
86
|
+
events: string[];
|
|
87
|
+
/** Additional filter criteria (dot-path field matching) */
|
|
88
|
+
filter?: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
/** Reference to a transform in a route */
|
|
91
|
+
export interface RouteTransformRef {
|
|
92
|
+
/** Transform name/ref */
|
|
93
|
+
ref: string;
|
|
94
|
+
/** Optional transform-specific config override */
|
|
95
|
+
config?: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
/** Route delivery target */
|
|
98
|
+
export interface RouteThen {
|
|
99
|
+
/** Actor ID to deliver to */
|
|
100
|
+
actor: string;
|
|
101
|
+
/** Actor-specific delivery config */
|
|
102
|
+
config?: Record<string, unknown>;
|
|
103
|
+
/** Delivery configuration (rate limit, retry, circuit breaker) */
|
|
104
|
+
delivery?: DeliveryConfig;
|
|
105
|
+
}
|
|
106
|
+
/** Delivery configuration for advanced routing */
|
|
107
|
+
export interface DeliveryConfig {
|
|
108
|
+
max_rate?: string;
|
|
109
|
+
queue_depth?: number;
|
|
110
|
+
retry?: RetryConfig;
|
|
111
|
+
circuit_breaker?: CircuitBreakerConfig;
|
|
112
|
+
}
|
|
113
|
+
/** Retry configuration */
|
|
114
|
+
export interface RetryConfig {
|
|
115
|
+
max_attempts: number;
|
|
116
|
+
backoff: 'exponential' | 'linear' | 'fixed';
|
|
117
|
+
initial_delay: string;
|
|
118
|
+
max_delay: string;
|
|
119
|
+
}
|
|
120
|
+
/** Circuit breaker configuration */
|
|
121
|
+
export interface CircuitBreakerConfig {
|
|
122
|
+
failure_threshold: number;
|
|
123
|
+
cooldown: string;
|
|
124
|
+
}
|
|
125
|
+
/** Route launch context — situational SOPs */
|
|
126
|
+
export interface RouteWith {
|
|
127
|
+
/** Path to a Markdown SOP file (relative to route YAML) */
|
|
128
|
+
prompt_file: string;
|
|
129
|
+
}
|
|
130
|
+
/** Route delivery config passed to ActorConnector.deliver() */
|
|
131
|
+
export interface RouteDeliveryConfig {
|
|
132
|
+
/** Actor-specific config from route's then.config */
|
|
133
|
+
[key: string]: unknown;
|
|
134
|
+
/** Resolved launch prompt text (from route's with.prompt_file) */
|
|
135
|
+
launch_prompt?: string;
|
|
136
|
+
/** Original prompt file path (for reference/logging) */
|
|
137
|
+
launch_prompt_file?: string;
|
|
138
|
+
}
|
|
139
|
+
/** Transform definition (YAML) */
|
|
140
|
+
export interface TransformDefinition {
|
|
141
|
+
/** Transform name */
|
|
142
|
+
name: string;
|
|
143
|
+
/** Transform type */
|
|
144
|
+
type: 'script' | 'package';
|
|
145
|
+
/** Script path (for type: script) */
|
|
146
|
+
script?: string;
|
|
147
|
+
/** Package name (for type: package) */
|
|
148
|
+
package?: string;
|
|
149
|
+
/** Transform-specific configuration */
|
|
150
|
+
config?: Record<string, unknown>;
|
|
151
|
+
/** Timeout in milliseconds (default: 30000) */
|
|
152
|
+
timeout_ms?: number;
|
|
153
|
+
}
|
|
154
|
+
/** Logger definition (YAML) */
|
|
155
|
+
export interface LoggerDefinition {
|
|
156
|
+
/** Logger name */
|
|
157
|
+
name: string;
|
|
158
|
+
/** Logger type (package reference) */
|
|
159
|
+
type: string;
|
|
160
|
+
/** Logger-specific configuration */
|
|
161
|
+
config: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
/** Pipeline phase identifiers */
|
|
164
|
+
export type LogPhase = 'source.emit' | 'transform.start' | 'transform.pass' | 'transform.drop' | 'transform.error' | 'route.match' | 'route.no_match' | 'deliver.attempt' | 'deliver.success' | 'deliver.failure' | 'deliver.retry' | 'system.start' | 'system.stop' | 'system.error';
|
|
165
|
+
/** Universal log entry — every logger receives this */
|
|
166
|
+
export interface LogEntry {
|
|
167
|
+
/** ISO 8601 timestamp (UTC) */
|
|
168
|
+
timestamp: string;
|
|
169
|
+
/** Unique event ID */
|
|
170
|
+
event_id: string;
|
|
171
|
+
/** Trace ID grouping all entries for one event's journey */
|
|
172
|
+
trace_id: string;
|
|
173
|
+
/** Pipeline phase */
|
|
174
|
+
phase: LogPhase;
|
|
175
|
+
/** Source ID */
|
|
176
|
+
source?: string;
|
|
177
|
+
/** Actor ID */
|
|
178
|
+
target?: string;
|
|
179
|
+
/** Route name */
|
|
180
|
+
route?: string;
|
|
181
|
+
/** Transform name */
|
|
182
|
+
transform?: string;
|
|
183
|
+
/** Event type */
|
|
184
|
+
event_type?: string;
|
|
185
|
+
/** Phase-specific result */
|
|
186
|
+
result?: string;
|
|
187
|
+
/** Phase duration in milliseconds */
|
|
188
|
+
duration_ms?: number;
|
|
189
|
+
/** Current queue depth (for backpressure visibility) */
|
|
190
|
+
queue_depth?: number;
|
|
191
|
+
/** Error message if applicable */
|
|
192
|
+
error?: string;
|
|
193
|
+
/** Additional context */
|
|
194
|
+
metadata?: Record<string, unknown>;
|
|
195
|
+
/** Runtime version */
|
|
196
|
+
orgloop_version?: string;
|
|
197
|
+
/** Machine hostname */
|
|
198
|
+
hostname?: string;
|
|
199
|
+
/** Active workspace name */
|
|
200
|
+
workspace?: string;
|
|
201
|
+
}
|
|
202
|
+
/** Root orgloop.yaml project configuration */
|
|
203
|
+
export interface ProjectConfig {
|
|
204
|
+
apiVersion: string;
|
|
205
|
+
kind: 'Project';
|
|
206
|
+
metadata: {
|
|
207
|
+
name: string;
|
|
208
|
+
description?: string;
|
|
209
|
+
};
|
|
210
|
+
defaults?: {
|
|
211
|
+
poll_interval?: string;
|
|
212
|
+
event_retention?: string;
|
|
213
|
+
log_level?: string;
|
|
214
|
+
};
|
|
215
|
+
connectors?: string[];
|
|
216
|
+
transforms?: string[];
|
|
217
|
+
loggers?: string[];
|
|
218
|
+
/** Installed modules with their parameter values */
|
|
219
|
+
modules?: Array<{
|
|
220
|
+
package: string;
|
|
221
|
+
params: Record<string, string | number | boolean>;
|
|
222
|
+
}>;
|
|
223
|
+
}
|
|
224
|
+
/** Full resolved OrgLoop configuration — everything needed to run */
|
|
225
|
+
export interface OrgLoopConfig {
|
|
226
|
+
/** Project metadata */
|
|
227
|
+
project: {
|
|
228
|
+
name: string;
|
|
229
|
+
description?: string;
|
|
230
|
+
};
|
|
231
|
+
/** Source definitions */
|
|
232
|
+
sources: SourceInstanceConfig[];
|
|
233
|
+
/** Actor definitions */
|
|
234
|
+
actors: ActorInstanceConfig[];
|
|
235
|
+
/** Route definitions */
|
|
236
|
+
routes: RouteDefinition[];
|
|
237
|
+
/** Transform definitions */
|
|
238
|
+
transforms: TransformDefinition[];
|
|
239
|
+
/** Logger definitions */
|
|
240
|
+
loggers: LoggerDefinition[];
|
|
241
|
+
/** Global defaults */
|
|
242
|
+
defaults?: {
|
|
243
|
+
poll_interval?: string;
|
|
244
|
+
event_retention?: string;
|
|
245
|
+
log_level?: string;
|
|
246
|
+
};
|
|
247
|
+
/** Data directory for WAL, checkpoints, etc. */
|
|
248
|
+
data_dir?: string;
|
|
249
|
+
}
|
|
250
|
+
/** Source instance config (resolved from YAML) */
|
|
251
|
+
export interface SourceInstanceConfig {
|
|
252
|
+
/** Source ID */
|
|
253
|
+
id: string;
|
|
254
|
+
/** Description */
|
|
255
|
+
description?: string;
|
|
256
|
+
/** Labels for filtering/grouping */
|
|
257
|
+
labels?: Record<string, string>;
|
|
258
|
+
/** Connector package reference */
|
|
259
|
+
connector: string;
|
|
260
|
+
/** Connector-specific config */
|
|
261
|
+
config: Record<string, unknown>;
|
|
262
|
+
/** Polling config */
|
|
263
|
+
poll?: PollConfig;
|
|
264
|
+
/** What event types this source emits */
|
|
265
|
+
emits?: string[];
|
|
266
|
+
}
|
|
267
|
+
/** Actor instance config (resolved from YAML) */
|
|
268
|
+
export interface ActorInstanceConfig {
|
|
269
|
+
/** Actor ID */
|
|
270
|
+
id: string;
|
|
271
|
+
/** Description */
|
|
272
|
+
description?: string;
|
|
273
|
+
/** Labels for filtering/grouping */
|
|
274
|
+
labels?: Record<string, string>;
|
|
275
|
+
/** Connector package reference */
|
|
276
|
+
connector: string;
|
|
277
|
+
/** Connector-specific config */
|
|
278
|
+
config: Record<string, unknown>;
|
|
279
|
+
}
|
|
280
|
+
/** Event filter for subscriptions */
|
|
281
|
+
export interface EventFilter {
|
|
282
|
+
/** Filter by source ID */
|
|
283
|
+
source?: string;
|
|
284
|
+
/** Filter by event type */
|
|
285
|
+
type?: OrgLoopEventType;
|
|
286
|
+
/** Filter by route name */
|
|
287
|
+
route?: string;
|
|
288
|
+
}
|
|
289
|
+
/** Event handler function */
|
|
290
|
+
export type EventHandler = (event: OrgLoopEvent) => Promise<void>;
|
|
291
|
+
/** Subscription handle */
|
|
292
|
+
export interface Subscription {
|
|
293
|
+
unsubscribe(): void;
|
|
294
|
+
}
|
|
295
|
+
/** Duration string (e.g., "5m", "30s", "1h", "7d") */
|
|
296
|
+
export type DurationString = string;
|
|
297
|
+
/** Parse a duration string to milliseconds */
|
|
298
|
+
export declare function parseDuration(duration: DurationString): number;
|
|
299
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEzF,iCAAiC;AACjC,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnF,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC/B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,mDAAmD;IACnD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,qFAAqF;AACrF,MAAM,WAAW,YAAY;IAC5B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,EAAE,gBAAgB,CAAC;IACvB,mDAAmD;IACnD,UAAU,EAAE,eAAe,CAAC;IAC5B,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC5B,+CAA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A2B;IAC3B,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,6BAA6B;AAC7B,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,0BAA0B;AAC1B,MAAM,WAAW,YAAY;IAC5B,WAAW,IAAI,IAAI,CAAC;CACpB;AAID,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAuB9D"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for OrgLoop.
|
|
3
|
+
*
|
|
4
|
+
* These types are the foundation of the system — every connector, transform,
|
|
5
|
+
* logger, and the core engine depend on them.
|
|
6
|
+
*/
|
|
7
|
+
/** Parse a duration string to milliseconds */
|
|
8
|
+
export function parseDuration(duration) {
|
|
9
|
+
const match = duration.match(/^(\d+)(ms|s|m|h|d)$/);
|
|
10
|
+
if (!match) {
|
|
11
|
+
throw new Error(`Invalid duration format: "${duration}". Expected format: <number><unit> (e.g., 5m, 30s, 1h, 7d)`);
|
|
12
|
+
}
|
|
13
|
+
const value = Number.parseInt(match[1], 10);
|
|
14
|
+
const unit = match[2];
|
|
15
|
+
switch (unit) {
|
|
16
|
+
case 'ms':
|
|
17
|
+
return value;
|
|
18
|
+
case 's':
|
|
19
|
+
return value * 1000;
|
|
20
|
+
case 'm':
|
|
21
|
+
return value * 60 * 1000;
|
|
22
|
+
case 'h':
|
|
23
|
+
return value * 60 * 60 * 1000;
|
|
24
|
+
case 'd':
|
|
25
|
+
return value * 24 * 60 * 60 * 1000;
|
|
26
|
+
default:
|
|
27
|
+
throw new Error(`Unknown duration unit: ${unit}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0VH,8CAA8C;AAC9C,MAAM,UAAU,aAAa,CAAC,QAAwB;IACrD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACpD,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACd,6BAA6B,QAAQ,4DAA4D,CACjG,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,IAAI;YACR,OAAO,KAAK,CAAC;QACd,KAAK,GAAG;YACP,OAAO,KAAK,GAAG,IAAI,CAAC;QACrB,KAAK,GAAG;YACP,OAAO,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC;QAC1B,KAAK,GAAG;YACP,OAAO,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAC/B,KAAK,GAAG;YACP,OAAO,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACpC;YACC,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;AACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orgloop/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OrgLoop plugin development kit — interfaces, base classes, and test harnesses",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^25.2.2"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run"
|
|
29
|
+
}
|
|
30
|
+
}
|