@junejuly-lockstep/sdk 0.1.1 → 0.2.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/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export { createIngestClient, INGEST_ROUTES } from './ingest.js';
3
3
  export type { IngestClient, IngestClientOptions } from './ingest.js';
4
4
  export { createSessionClient, SESSION_ROUTES } from './session.js';
5
5
  export type { ConditionalOptions, JudgmentAction, RunArtifactsResponse, SessionClient, SessionClientOptions, } from './session.js';
6
+ export { AGENT_ROUTES, CHECK_ROUTES, DEVICE_ROUTES, createAgentClient, createCheckClient, createDeviceClient, } from './v2.js';
7
+ export type { AgentClient, ApiKeyClientOptions, CheckClient, DeviceClient, DeviceClientOptions, } from './v2.js';
6
8
  export { joinUrl, DEFAULT_RETRY } from './http.js';
7
9
  export type { Conditional, FetchLike, RetryPolicy } from './http.js';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { LockstepApiError, LockstepNetworkError } from './errors.js';
2
2
  export { createIngestClient, INGEST_ROUTES } from './ingest.js';
3
3
  export { createSessionClient, SESSION_ROUTES } from './session.js';
4
+ export { AGENT_ROUTES, CHECK_ROUTES, DEVICE_ROUTES, createAgentClient, createCheckClient, createDeviceClient, } from './v2.js';
4
5
  export { joinUrl, DEFAULT_RETRY } from './http.js';
5
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQnE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQnE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAQjB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
package/dist/session.d.ts CHANGED
@@ -232,8 +232,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
232
232
  delta: {
233
233
  addStates: Record<string, {
234
234
  meta: {
235
- route: string;
236
235
  testId: string;
236
+ route: string;
237
237
  intent: string;
238
238
  rules: string[];
239
239
  referenceAsset?: string | undefined;
@@ -243,26 +243,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
243
243
  removeStates: string[];
244
244
  addTransitions: {
245
245
  from: string;
246
- event: string;
247
246
  to: string;
247
+ event: string;
248
248
  guard?: string | undefined;
249
249
  }[];
250
250
  removeTransitions: {
251
251
  from: string;
252
- event: string;
253
252
  to: string;
253
+ event: string;
254
254
  }[];
255
255
  updateMeta: Record<string, {
256
- route?: string | undefined;
257
256
  testId?: string | undefined;
257
+ route?: string | undefined;
258
258
  intent?: string | undefined;
259
259
  rules?: string[] | undefined;
260
260
  referenceAsset?: string | undefined;
261
261
  }>;
262
262
  addBindings: {
263
- testId: string;
264
263
  from: string;
265
264
  event: string;
265
+ testId: string;
266
266
  label?: string | undefined;
267
267
  }[];
268
268
  } | null;
@@ -296,7 +296,7 @@ export declare function createSessionClient(options: SessionClientOptions): {
296
296
  sealedAt: string | null;
297
297
  events: {
298
298
  id: string;
299
- kind: "dispatched" | "created" | "verdict" | "adopted" | "deferred" | "approved" | "acknowledged" | "sealed" | "pr_linked" | "pr_merged" | "reopened";
299
+ kind: "dispatched" | "created" | "verdict" | "adopted" | "deferred" | "approved" | "acknowledged" | "sealed" | "pr_linked" | "pr_merged" | "pr_closed" | "reopened";
300
300
  detail: Record<string, unknown>;
301
301
  createdAt: string;
302
302
  cardId: string;
@@ -304,9 +304,9 @@ export declare function createSessionClient(options: SessionClientOptions): {
304
304
  }[];
305
305
  workOrder: {
306
306
  bindings: {
307
- testId: string;
308
307
  from: string;
309
308
  event: string;
309
+ testId: string;
310
310
  label?: string | undefined;
311
311
  }[];
312
312
  cardRef: string;
@@ -374,8 +374,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
374
374
  delta: {
375
375
  addStates: Record<string, {
376
376
  meta: {
377
- route: string;
378
377
  testId: string;
378
+ route: string;
379
379
  intent: string;
380
380
  rules: string[];
381
381
  referenceAsset?: string | undefined;
@@ -385,26 +385,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
385
385
  removeStates: string[];
386
386
  addTransitions: {
387
387
  from: string;
388
- event: string;
389
388
  to: string;
389
+ event: string;
390
390
  guard?: string | undefined;
391
391
  }[];
392
392
  removeTransitions: {
393
393
  from: string;
394
- event: string;
395
394
  to: string;
395
+ event: string;
396
396
  }[];
397
397
  updateMeta: Record<string, {
398
- route?: string | undefined;
399
398
  testId?: string | undefined;
399
+ route?: string | undefined;
400
400
  intent?: string | undefined;
401
401
  rules?: string[] | undefined;
402
402
  referenceAsset?: string | undefined;
403
403
  }>;
404
404
  addBindings: {
405
- testId: string;
406
405
  from: string;
407
406
  event: string;
407
+ testId: string;
408
408
  label?: string | undefined;
409
409
  }[];
410
410
  } | null;
@@ -481,8 +481,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
481
481
  delta: {
482
482
  addStates: Record<string, {
483
483
  meta: {
484
- route: string;
485
484
  testId: string;
485
+ route: string;
486
486
  intent: string;
487
487
  rules: string[];
488
488
  referenceAsset?: string | undefined;
@@ -492,26 +492,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
492
492
  removeStates: string[];
493
493
  addTransitions: {
494
494
  from: string;
495
- event: string;
496
495
  to: string;
496
+ event: string;
497
497
  guard?: string | undefined;
498
498
  }[];
499
499
  removeTransitions: {
500
500
  from: string;
501
- event: string;
502
501
  to: string;
502
+ event: string;
503
503
  }[];
504
504
  updateMeta: Record<string, {
505
- route?: string | undefined;
506
505
  testId?: string | undefined;
506
+ route?: string | undefined;
507
507
  intent?: string | undefined;
508
508
  rules?: string[] | undefined;
509
509
  referenceAsset?: string | undefined;
510
510
  }>;
511
511
  addBindings: {
512
- testId: string;
513
512
  from: string;
514
513
  event: string;
514
+ testId: string;
515
515
  label?: string | undefined;
516
516
  }[];
517
517
  } | null;
@@ -588,8 +588,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
588
588
  delta: {
589
589
  addStates: Record<string, {
590
590
  meta: {
591
- route: string;
592
591
  testId: string;
592
+ route: string;
593
593
  intent: string;
594
594
  rules: string[];
595
595
  referenceAsset?: string | undefined;
@@ -599,26 +599,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
599
599
  removeStates: string[];
600
600
  addTransitions: {
601
601
  from: string;
602
- event: string;
603
602
  to: string;
603
+ event: string;
604
604
  guard?: string | undefined;
605
605
  }[];
606
606
  removeTransitions: {
607
607
  from: string;
608
- event: string;
609
608
  to: string;
609
+ event: string;
610
610
  }[];
611
611
  updateMeta: Record<string, {
612
- route?: string | undefined;
613
612
  testId?: string | undefined;
613
+ route?: string | undefined;
614
614
  intent?: string | undefined;
615
615
  rules?: string[] | undefined;
616
616
  referenceAsset?: string | undefined;
617
617
  }>;
618
618
  addBindings: {
619
- testId: string;
620
619
  from: string;
621
620
  event: string;
621
+ testId: string;
622
622
  label?: string | undefined;
623
623
  }[];
624
624
  } | null;
@@ -695,8 +695,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
695
695
  delta: {
696
696
  addStates: Record<string, {
697
697
  meta: {
698
- route: string;
699
698
  testId: string;
699
+ route: string;
700
700
  intent: string;
701
701
  rules: string[];
702
702
  referenceAsset?: string | undefined;
@@ -706,26 +706,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
706
706
  removeStates: string[];
707
707
  addTransitions: {
708
708
  from: string;
709
- event: string;
710
709
  to: string;
710
+ event: string;
711
711
  guard?: string | undefined;
712
712
  }[];
713
713
  removeTransitions: {
714
714
  from: string;
715
- event: string;
716
715
  to: string;
716
+ event: string;
717
717
  }[];
718
718
  updateMeta: Record<string, {
719
- route?: string | undefined;
720
719
  testId?: string | undefined;
720
+ route?: string | undefined;
721
721
  intent?: string | undefined;
722
722
  rules?: string[] | undefined;
723
723
  referenceAsset?: string | undefined;
724
724
  }>;
725
725
  addBindings: {
726
- testId: string;
727
726
  from: string;
728
727
  event: string;
728
+ testId: string;
729
729
  label?: string | undefined;
730
730
  }[];
731
731
  } | null;
@@ -802,8 +802,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
802
802
  delta: {
803
803
  addStates: Record<string, {
804
804
  meta: {
805
- route: string;
806
805
  testId: string;
806
+ route: string;
807
807
  intent: string;
808
808
  rules: string[];
809
809
  referenceAsset?: string | undefined;
@@ -813,26 +813,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
813
813
  removeStates: string[];
814
814
  addTransitions: {
815
815
  from: string;
816
- event: string;
817
816
  to: string;
817
+ event: string;
818
818
  guard?: string | undefined;
819
819
  }[];
820
820
  removeTransitions: {
821
821
  from: string;
822
- event: string;
823
822
  to: string;
823
+ event: string;
824
824
  }[];
825
825
  updateMeta: Record<string, {
826
- route?: string | undefined;
827
826
  testId?: string | undefined;
827
+ route?: string | undefined;
828
828
  intent?: string | undefined;
829
829
  rules?: string[] | undefined;
830
830
  referenceAsset?: string | undefined;
831
831
  }>;
832
832
  addBindings: {
833
- testId: string;
834
833
  from: string;
835
834
  event: string;
835
+ testId: string;
836
836
  label?: string | undefined;
837
837
  }[];
838
838
  } | null;
@@ -909,8 +909,8 @@ export declare function createSessionClient(options: SessionClientOptions): {
909
909
  delta: {
910
910
  addStates: Record<string, {
911
911
  meta: {
912
- route: string;
913
912
  testId: string;
913
+ route: string;
914
914
  intent: string;
915
915
  rules: string[];
916
916
  referenceAsset?: string | undefined;
@@ -920,26 +920,26 @@ export declare function createSessionClient(options: SessionClientOptions): {
920
920
  removeStates: string[];
921
921
  addTransitions: {
922
922
  from: string;
923
- event: string;
924
923
  to: string;
924
+ event: string;
925
925
  guard?: string | undefined;
926
926
  }[];
927
927
  removeTransitions: {
928
928
  from: string;
929
- event: string;
930
929
  to: string;
930
+ event: string;
931
931
  }[];
932
932
  updateMeta: Record<string, {
933
- route?: string | undefined;
934
933
  testId?: string | undefined;
934
+ route?: string | undefined;
935
935
  intent?: string | undefined;
936
936
  rules?: string[] | undefined;
937
937
  referenceAsset?: string | undefined;
938
938
  }>;
939
939
  addBindings: {
940
- testId: string;
941
940
  from: string;
942
941
  event: string;
942
+ testId: string;
943
943
  label?: string | undefined;
944
944
  }[];
945
945
  } | null;
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,aAAa,EAGb,gBAAgB,EAGhB,uBAAuB,EAEvB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAOhB,sBAAsB,EACtB,mBAAmB,EAEnB,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE3F,MAAM,WAAW,oBAAoB;IACnC,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB,K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AsD,CAAC;;;;;;yBAAmL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BApE39gF,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC;;;;;;;;;;;;0BAQzC,MAAM,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC;;;;;;;;;;;;iBAU5D,MAAM;;;;;;;;;;;;0BAEG,MAAM;;;;;;;;wBAQR,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC;;;;;;;;;;;iBAwCskhR,CAAC;;;;;;;;6BA5BnmhR,KAAK,GAAG,IAAI,GAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAQnC;QAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;6BAQ/D,MAAM;EASlC;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
package/dist/v2.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ import { AgentStartedRequest, CheckPayload, DeviceCodeRequest, DeviceCodeResponse, DeviceTokenResponse, IngestCheckResponse, IngestProjectDto, IntentManifest, LinkPrRequest, PresignCheckRequest, PresignCheckResponse, ScreenContextDto, TicketContextDto, TicketDto, type TicketStatus } from '@junejuly-lockstep/model/v2';
3
+ import { type FetchLike, type RetryPolicy } from './http.js';
4
+ /**
5
+ * Lockstep v2 clients (docs/REDESIGN.md). Every route the CLI calls is listed here so the API can
6
+ * be reconciled against one table.
7
+ */
8
+ export declare const CHECK_ROUTES: {
9
+ readonly presign: "/api/ingest/checks/presign";
10
+ readonly checks: "/api/ingest/checks";
11
+ readonly intentManifest: "/api/ingest/intent-manifest";
12
+ };
13
+ export declare const DEVICE_ROUTES: {
14
+ readonly start: "/api/cli/device";
15
+ readonly token: "/api/cli/device/token";
16
+ };
17
+ export declare const AGENT_ROUTES: {
18
+ readonly project: "/api/ingest/project";
19
+ readonly tickets: "/api/ingest/tickets";
20
+ readonly ticketContext: (ref: string) => string;
21
+ readonly ticketPrs: (ref: string) => string;
22
+ readonly ticketComments: (ref: string) => string;
23
+ readonly ticketAgentStarted: (ref: string) => string;
24
+ readonly screen: "/api/ingest/screens";
25
+ };
26
+ export interface ApiKeyClientOptions {
27
+ /** Platform API origin, e.g. https://api-staging.lockstep.junejuly.dev */
28
+ baseUrl: string;
29
+ /** Project API key, `lsk_...`. Sent as `Authorization: Bearer`. */
30
+ apiKey: string;
31
+ fetch?: FetchLike;
32
+ retry?: Partial<RetryPolicy>;
33
+ }
34
+ export interface CheckClient {
35
+ /** POST /api/ingest/checks/presign: presigned PUTs, at most 50 files per call; the first call reserves the check id. */
36
+ presign(req: PresignCheckRequest): Promise<PresignCheckResponse>;
37
+ /** POST /api/ingest/checks: the reality map and visual scores of one check. */
38
+ postCheck(payload: CheckPayload): Promise<IngestCheckResponse>;
39
+ /** GET /api/ingest/intent-manifest?project=KEY: intent screenshots with presigned GETs; null on 404. */
40
+ getIntentManifest(projectKey: string): Promise<IntentManifest | null>;
41
+ }
42
+ export declare function createCheckClient(options: ApiKeyClientOptions): CheckClient;
43
+ export interface DeviceClientOptions {
44
+ baseUrl: string;
45
+ fetch?: FetchLike;
46
+ retry?: Partial<RetryPolicy>;
47
+ }
48
+ export interface DeviceClient {
49
+ /** POST /api/cli/device: no auth; returns the user code and verification URL. */
50
+ start(req: z.input<typeof DeviceCodeRequest>): Promise<DeviceCodeResponse>;
51
+ /** POST /api/cli/device/token: one poll. A non-2xx body that is a token status is returned too. */
52
+ poll(deviceCode: string): Promise<DeviceTokenResponse>;
53
+ }
54
+ export declare function createDeviceClient(options: DeviceClientOptions): DeviceClient;
55
+ export interface AgentClient {
56
+ getProject(): Promise<IngestProjectDto>;
57
+ listTickets(status?: TicketStatus[]): Promise<TicketDto[]>;
58
+ getTicketContext(ref: string): Promise<TicketContextDto>;
59
+ getScreen(screenKey: string, env?: string): Promise<ScreenContextDto>;
60
+ linkPr(ref: string, req: z.input<typeof LinkPrRequest>): Promise<unknown>;
61
+ addComment(ref: string, text: string): Promise<unknown>;
62
+ agentStarted(ref: string, req?: z.input<typeof AgentStartedRequest>): Promise<unknown>;
63
+ }
64
+ export declare function createAgentClient(options: ApiKeyClientOptions): AgentClient;
65
+ //# sourceMappingURL=v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../src/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAElB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EAET,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAIX,eAAO,MAAM,YAAY;;;kCAGF,MAAM;8BACV,MAAM;mCACD,MAAM;uCACF,MAAM;;CAExB,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9B;AAgBD,MAAM,WAAW,WAAW;IAC1B,wHAAwH;IACxH,OAAO,C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,aAAa,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1E,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,CAwD3E"}
package/dist/v2.js ADDED
@@ -0,0 +1,184 @@
1
+ import { z } from 'zod';
2
+ import { AddTicketCommentRequest, AgentStartedRequest, CheckPayload, DeviceCodeRequest, DeviceCodeResponse, DeviceTokenRequest, DeviceTokenResponse, IngestCheckResponse, IngestProjectDto, IntentManifest, LinkPrRequest, PresignCheckRequest, PresignCheckResponse, ScreenContextDto, TicketContextDto, TicketDto, TicketListDto, } from '@junejuly-lockstep/model/v2';
3
+ import { LockstepApiError } from './errors.js';
4
+ import { createHttp } from './http.js';
5
+ /**
6
+ * Lockstep v2 clients (docs/REDESIGN.md). Every route the CLI calls is listed here so the API can
7
+ * be reconciled against one table.
8
+ */
9
+ export const CHECK_ROUTES = {
10
+ presign: '/api/ingest/checks/presign',
11
+ checks: '/api/ingest/checks',
12
+ intentManifest: '/api/ingest/intent-manifest',
13
+ };
14
+ export const DEVICE_ROUTES = {
15
+ start: '/api/cli/device',
16
+ token: '/api/cli/device/token',
17
+ };
18
+ const enc = (ref) => encodeURIComponent(ref);
19
+ export const AGENT_ROUTES = {
20
+ project: '/api/ingest/project',
21
+ tickets: '/api/ingest/tickets',
22
+ ticketContext: (ref) => `/api/ingest/tickets/${enc(ref)}/context`,
23
+ ticketPrs: (ref) => `/api/ingest/tickets/${enc(ref)}/prs`,
24
+ ticketComments: (ref) => `/api/ingest/tickets/${enc(ref)}/comments`,
25
+ ticketAgentStarted: (ref) => `/api/ingest/tickets/${enc(ref)}/agent-started`,
26
+ screen: '/api/ingest/screens',
27
+ };
28
+ function apiKeyHttp(options, who) {
29
+ if (!options.apiKey)
30
+ throw new Error(`${who}: apiKey is required`);
31
+ if (!options.apiKey.startsWith('lsk_'))
32
+ throw new Error(`${who}: apiKey must be a project key starting with lsk_`);
33
+ return createHttp({
34
+ baseUrl: options.baseUrl,
35
+ fetch: options.fetch,
36
+ retry: options.retry,
37
+ headers: { authorization: `Bearer ${options.apiKey}` },
38
+ });
39
+ }
40
+ export function createCheckClient(options) {
41
+ const http = apiKeyHttp(options, 'createCheckClient');
42
+ return {
43
+ async presign(req) {
44
+ return http.request({
45
+ method: 'POST',
46
+ path: CHECK_ROUTES.presign,
47
+ body: PresignCheckRequest.parse(req),
48
+ schema: PresignCheckResponse,
49
+ // Presign is idempotent for a given check id; retry transient failures.
50
+ idempotent: req.checkId !== undefined,
51
+ });
52
+ },
53
+ async postCheck(payload) {
54
+ return http.request({
55
+ method: 'POST',
56
+ path: CHECK_ROUTES.checks,
57
+ body: CheckPayload.parse(payload),
58
+ schema: IngestCheckResponse,
59
+ });
60
+ },
61
+ async getIntentManifest(projectKey) {
62
+ try {
63
+ return await http.request({
64
+ method: 'GET',
65
+ path: CHECK_ROUTES.intentManifest,
66
+ query: { project: projectKey },
67
+ schema: IntentManifest,
68
+ });
69
+ }
70
+ catch (err) {
71
+ if (err instanceof LockstepApiError && err.status === 404)
72
+ return null;
73
+ throw err;
74
+ }
75
+ },
76
+ };
77
+ }
78
+ export function createDeviceClient(options) {
79
+ const http = createHttp({ baseUrl: options.baseUrl, fetch: options.fetch, retry: options.retry });
80
+ return {
81
+ async start(req) {
82
+ return http.request({
83
+ method: 'POST',
84
+ path: DEVICE_ROUTES.start,
85
+ body: DeviceCodeRequest.parse(req),
86
+ schema: DeviceCodeResponse,
87
+ });
88
+ },
89
+ async poll(deviceCode) {
90
+ const body = DeviceTokenRequest.parse({ deviceCode });
91
+ const { response, url } = await http.raw({
92
+ method: 'POST',
93
+ path: DEVICE_ROUTES.token,
94
+ body,
95
+ schema: DeviceTokenResponse,
96
+ idempotent: true,
97
+ });
98
+ const text = await response.text();
99
+ let json = null;
100
+ try {
101
+ json = text ? JSON.parse(text) : null;
102
+ }
103
+ catch {
104
+ json = text;
105
+ }
106
+ const parsed = DeviceTokenResponse.safeParse(json);
107
+ if (parsed.success)
108
+ return parsed.data;
109
+ throw new LockstepApiError({
110
+ status: response.status,
111
+ body: json,
112
+ method: 'POST',
113
+ url,
114
+ message: response.ok
115
+ ? `POST ${url} returned a body that is not a device token status`
116
+ : undefined,
117
+ });
118
+ },
119
+ };
120
+ }
121
+ /* ------------------------------------------------------------------ agents (mcp, work orders) */
122
+ /** The list endpoint may answer `{ tickets }` or a bare array; both parse to `{ tickets }`. */
123
+ const TicketListResponse = z.union([
124
+ TicketListDto,
125
+ z.array(TicketDto).transform((tickets) => ({ tickets })),
126
+ ]);
127
+ export function createAgentClient(options) {
128
+ const http = apiKeyHttp(options, 'createAgentClient');
129
+ const anyBody = z.unknown();
130
+ return {
131
+ async getProject() {
132
+ return http.request({ method: 'GET', path: AGENT_ROUTES.project, schema: IngestProjectDto });
133
+ },
134
+ async listTickets(status) {
135
+ const res = await http.request({
136
+ method: 'GET',
137
+ path: AGENT_ROUTES.tickets,
138
+ query: { status: status && status.length > 0 ? status.join(',') : undefined },
139
+ schema: TicketListResponse,
140
+ });
141
+ return res.tickets;
142
+ },
143
+ async getTicketContext(ref) {
144
+ return http.request({
145
+ method: 'GET',
146
+ path: AGENT_ROUTES.ticketContext(ref),
147
+ schema: TicketContextDto,
148
+ });
149
+ },
150
+ async getScreen(screenKey, env) {
151
+ return http.request({
152
+ method: 'GET',
153
+ path: AGENT_ROUTES.screen,
154
+ query: { key: screenKey, env },
155
+ schema: ScreenContextDto,
156
+ });
157
+ },
158
+ async linkPr(ref, req) {
159
+ return http.request({
160
+ method: 'POST',
161
+ path: AGENT_ROUTES.ticketPrs(ref),
162
+ body: LinkPrRequest.parse(req),
163
+ schema: anyBody,
164
+ });
165
+ },
166
+ async addComment(ref, text) {
167
+ return http.request({
168
+ method: 'POST',
169
+ path: AGENT_ROUTES.ticketComments(ref),
170
+ body: AddTicketCommentRequest.parse({ text }),
171
+ schema: anyBody,
172
+ });
173
+ },
174
+ async agentStarted(ref, req = {}) {
175
+ return http.request({
176
+ method: 'POST',
177
+ path: AGENT_ROUTES.ticketAgentStarted(ref),
178
+ body: AgentStartedRequest.parse(req),
179
+ schema: anyBody,
180
+ });
181
+ },
182
+ };
183
+ }
184
+ //# sourceMappingURL=v2.js.map
package/dist/v2.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.js","sourceRoot":"","sources":["../src/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,aAAa,GAEd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAoC,MAAM,WAAW,CAAC;AAEzE;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,4BAA4B;IACrC,MAAM,EAAE,oBAAoB;IAC5B,cAAc,EAAE,6BAA6B;CACrC,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,uBAAuB;CACtB,CAAC;AAEX,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAErD,MAAM,CA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BAClB,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,YAAY,CAAC,MAAM;gBACzB,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE;gBAC9B,MAAM,EAAE,gBAAgB;aACzB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG;YACnB,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC;gBACjC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC;gBAC9B,MAAM,EAAE,OAAO;aAChB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI;YACxB,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC;gBACtC,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;gBAC7C,MAAM,EAAE,OAAO;aAChB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE;YAC9B,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC;gBAC1C,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC;gBACpC,MAAM,EAAE,OAAO;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@junejuly-lockstep/sdk",
3
- "version": "0.1.1",
4
- "description": "Typed fetch client for the Lockstep platform: ingest API (runs, presign, baselines, model sync) and the session read API.",
3
+ "version": "0.2.0",
4
+ "description": "Typed fetch client for the Lockstep platform: v2 check ingest, CLI device authorization and agent (ticket) clients, plus the v1 ingest and session read APIs.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "zod": "^3.24.1",
48
- "@junejuly-lockstep/model": "0.1.1"
48
+ "@junejuly-lockstep/model": "0.2.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "typescript": "^5.7.2",