@ai-devkit/daemon-client 0.4.1 → 0.5.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/client.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import type { DurableAgentWire } from "./gen/DurableAgentWire.js";
2
+ import type { DurableRunWire } from "./gen/DurableRunWire.js";
3
+ import type { AgentGroup } from "./gen/AgentGroup.js";
1
4
  import type { AgentStartParams } from "./gen/AgentStartParams.js";
2
5
  import type { AgentStartResult } from "./gen/AgentStartResult.js";
3
6
  import type { AgentLookupResult } from "./gen/AgentLookupResult.js";
@@ -17,6 +20,20 @@ export declare class DaemonRpcError extends Error {
17
20
  constructor(message: string, code?: string | undefined, details?: unknown | undefined);
18
21
  }
19
22
  export declare function daemonSocketPath(): string;
23
+ export interface DurableCreateParams {
24
+ name: string;
25
+ provider?: "claude" | "codex" | "pi";
26
+ cwd: string;
27
+ }
28
+ export interface DurableLaunchResult {
29
+ agent: DurableAgentWire;
30
+ runId: string;
31
+ }
32
+ export interface DurableRunDetail {
33
+ agent: DurableAgentWire;
34
+ run: DurableRunWire | null;
35
+ }
36
+ export type DurableResolution = DurableAgentWire | DurableAgentWire[] | null;
20
37
  /**
21
38
  * Line-delimited JSON-RPC client for devkitd. One request per line;
22
39
  * events arrive as `{"event": {...}}` frames after `subscribe`.
@@ -77,6 +94,27 @@ export declare class DaemonClient {
77
94
  * `runtime_unavailable`, `invalid_params`.
78
95
  */
79
96
  renameAgent(from: string, to: string): Promise<AgentRenameResult>;
97
+ durableCapabilities(): Promise<{
98
+ version: number;
99
+ owner: string;
100
+ }>;
101
+ createDurable(params: DurableCreateParams): Promise<DurableAgentWire>;
102
+ listDurable(): Promise<DurableAgentWire[]>;
103
+ showDurable(reference: string): Promise<DurableResolution>;
104
+ showDurable(reference: string, runId: string): Promise<DurableRunDetail>;
105
+ sendDurable(id: string, prompt: string): Promise<DurableLaunchResult>;
106
+ runDurable(id: string, prompt: string): Promise<DurableLaunchResult>;
107
+ stopDurable(id: string, runId?: string): Promise<DurableAgentWire>;
108
+ createGroup(name: string, members: string[]): Promise<AgentGroup>;
109
+ updateGroup(name: string, members: string[]): Promise<AgentGroup>;
110
+ addGroupMember(name: string, member: string): Promise<AgentGroup>;
111
+ removeGroupMember(name: string, member: string): Promise<AgentGroup>;
112
+ removeGroup(name: string): Promise<{
113
+ ok: boolean;
114
+ }>;
115
+ listGroups(): Promise<AgentGroup[]>;
116
+ getGroup(name: string): Promise<AgentGroup>;
117
+ lookupGroup(name: string): Promise<AgentGroup>;
80
118
  private onData;
81
119
  /** Reject every in-flight request and mark the socket dead. Idempotent. */
82
120
  private onSocketDead;
package/dist/client.js CHANGED
@@ -529,6 +529,351 @@ export function daemonSocketPath() {
529
529
  }).call(this);
530
530
  }
531
531
  },
532
+ {
533
+ key: "durableCapabilities",
534
+ value: function durableCapabilities() {
535
+ return _async_to_generator(function() {
536
+ return _ts_generator(this, function(_state) {
537
+ switch(_state.label){
538
+ case 0:
539
+ return [
540
+ 4,
541
+ this.request("durable.capabilities")
542
+ ];
543
+ case 1:
544
+ return [
545
+ 2,
546
+ _state.sent()
547
+ ];
548
+ }
549
+ });
550
+ }).call(this);
551
+ }
552
+ },
553
+ {
554
+ key: "createDurable",
555
+ value: function createDurable(params) {
556
+ return _async_to_generator(function() {
557
+ return _ts_generator(this, function(_state) {
558
+ switch(_state.label){
559
+ case 0:
560
+ return [
561
+ 4,
562
+ this.request("durable.create", params)
563
+ ];
564
+ case 1:
565
+ return [
566
+ 2,
567
+ _state.sent()
568
+ ];
569
+ }
570
+ });
571
+ }).call(this);
572
+ }
573
+ },
574
+ {
575
+ key: "listDurable",
576
+ value: function listDurable() {
577
+ return _async_to_generator(function() {
578
+ return _ts_generator(this, function(_state) {
579
+ switch(_state.label){
580
+ case 0:
581
+ return [
582
+ 4,
583
+ this.request("durable.list")
584
+ ];
585
+ case 1:
586
+ return [
587
+ 2,
588
+ _state.sent()
589
+ ];
590
+ }
591
+ });
592
+ }).call(this);
593
+ }
594
+ },
595
+ {
596
+ key: "showDurable",
597
+ value: function showDurable(reference, runId) {
598
+ return _async_to_generator(function() {
599
+ return _ts_generator(this, function(_state) {
600
+ switch(_state.label){
601
+ case 0:
602
+ return [
603
+ 4,
604
+ this.request("durable.show", {
605
+ reference: reference,
606
+ runId: runId
607
+ })
608
+ ];
609
+ case 1:
610
+ return [
611
+ 2,
612
+ _state.sent()
613
+ ];
614
+ }
615
+ });
616
+ }).call(this);
617
+ }
618
+ },
619
+ {
620
+ key: "sendDurable",
621
+ value: function sendDurable(id, prompt) {
622
+ return _async_to_generator(function() {
623
+ return _ts_generator(this, function(_state) {
624
+ switch(_state.label){
625
+ case 0:
626
+ return [
627
+ 4,
628
+ this.request("durable.send", {
629
+ id: id,
630
+ prompt: prompt
631
+ })
632
+ ];
633
+ case 1:
634
+ return [
635
+ 2,
636
+ _state.sent()
637
+ ];
638
+ }
639
+ });
640
+ }).call(this);
641
+ }
642
+ },
643
+ {
644
+ key: "runDurable",
645
+ value: function runDurable(id, prompt) {
646
+ return _async_to_generator(function() {
647
+ return _ts_generator(this, function(_state) {
648
+ switch(_state.label){
649
+ case 0:
650
+ return [
651
+ 4,
652
+ this.request("durable.run", {
653
+ id: id,
654
+ prompt: prompt
655
+ })
656
+ ];
657
+ case 1:
658
+ return [
659
+ 2,
660
+ _state.sent()
661
+ ];
662
+ }
663
+ });
664
+ }).call(this);
665
+ }
666
+ },
667
+ {
668
+ key: "stopDurable",
669
+ value: function stopDurable(id, runId) {
670
+ return _async_to_generator(function() {
671
+ return _ts_generator(this, function(_state) {
672
+ switch(_state.label){
673
+ case 0:
674
+ return [
675
+ 4,
676
+ this.request("durable.stop", {
677
+ id: id,
678
+ runId: runId
679
+ })
680
+ ];
681
+ case 1:
682
+ return [
683
+ 2,
684
+ _state.sent()
685
+ ];
686
+ }
687
+ });
688
+ }).call(this);
689
+ }
690
+ },
691
+ {
692
+ key: "createGroup",
693
+ value: function createGroup(name, members) {
694
+ return _async_to_generator(function() {
695
+ return _ts_generator(this, function(_state) {
696
+ switch(_state.label){
697
+ case 0:
698
+ return [
699
+ 4,
700
+ this.request("group.create", {
701
+ name: name,
702
+ members: members
703
+ })
704
+ ];
705
+ case 1:
706
+ return [
707
+ 2,
708
+ _state.sent()
709
+ ];
710
+ }
711
+ });
712
+ }).call(this);
713
+ }
714
+ },
715
+ {
716
+ key: "updateGroup",
717
+ value: function updateGroup(name, members) {
718
+ return _async_to_generator(function() {
719
+ return _ts_generator(this, function(_state) {
720
+ switch(_state.label){
721
+ case 0:
722
+ return [
723
+ 4,
724
+ this.request("group.update", {
725
+ name: name,
726
+ members: members
727
+ })
728
+ ];
729
+ case 1:
730
+ return [
731
+ 2,
732
+ _state.sent()
733
+ ];
734
+ }
735
+ });
736
+ }).call(this);
737
+ }
738
+ },
739
+ {
740
+ key: "addGroupMember",
741
+ value: function addGroupMember(name, member) {
742
+ return _async_to_generator(function() {
743
+ return _ts_generator(this, function(_state) {
744
+ switch(_state.label){
745
+ case 0:
746
+ return [
747
+ 4,
748
+ this.request("group.add", {
749
+ name: name,
750
+ member: member
751
+ })
752
+ ];
753
+ case 1:
754
+ return [
755
+ 2,
756
+ _state.sent()
757
+ ];
758
+ }
759
+ });
760
+ }).call(this);
761
+ }
762
+ },
763
+ {
764
+ key: "removeGroupMember",
765
+ value: function removeGroupMember(name, member) {
766
+ return _async_to_generator(function() {
767
+ return _ts_generator(this, function(_state) {
768
+ switch(_state.label){
769
+ case 0:
770
+ return [
771
+ 4,
772
+ this.request("group.remove_agent", {
773
+ name: name,
774
+ member: member
775
+ })
776
+ ];
777
+ case 1:
778
+ return [
779
+ 2,
780
+ _state.sent()
781
+ ];
782
+ }
783
+ });
784
+ }).call(this);
785
+ }
786
+ },
787
+ {
788
+ key: "removeGroup",
789
+ value: function removeGroup(name) {
790
+ return _async_to_generator(function() {
791
+ return _ts_generator(this, function(_state) {
792
+ switch(_state.label){
793
+ case 0:
794
+ return [
795
+ 4,
796
+ this.request("group.remove", {
797
+ name: name
798
+ })
799
+ ];
800
+ case 1:
801
+ return [
802
+ 2,
803
+ _state.sent()
804
+ ];
805
+ }
806
+ });
807
+ }).call(this);
808
+ }
809
+ },
810
+ {
811
+ key: "listGroups",
812
+ value: function listGroups() {
813
+ return _async_to_generator(function() {
814
+ return _ts_generator(this, function(_state) {
815
+ switch(_state.label){
816
+ case 0:
817
+ return [
818
+ 4,
819
+ this.request("group.list", {})
820
+ ];
821
+ case 1:
822
+ return [
823
+ 2,
824
+ _state.sent()
825
+ ];
826
+ }
827
+ });
828
+ }).call(this);
829
+ }
830
+ },
831
+ {
832
+ key: "getGroup",
833
+ value: function getGroup(name) {
834
+ return _async_to_generator(function() {
835
+ return _ts_generator(this, function(_state) {
836
+ switch(_state.label){
837
+ case 0:
838
+ return [
839
+ 4,
840
+ this.request("group.detail", {
841
+ name: name
842
+ })
843
+ ];
844
+ case 1:
845
+ return [
846
+ 2,
847
+ _state.sent()
848
+ ];
849
+ }
850
+ });
851
+ }).call(this);
852
+ }
853
+ },
854
+ {
855
+ key: "lookupGroup",
856
+ value: function lookupGroup(name) {
857
+ return _async_to_generator(function() {
858
+ return _ts_generator(this, function(_state) {
859
+ switch(_state.label){
860
+ case 0:
861
+ return [
862
+ 4,
863
+ this.request("group.lookup", {
864
+ name: name
865
+ })
866
+ ];
867
+ case 1:
868
+ return [
869
+ 2,
870
+ _state.sent()
871
+ ];
872
+ }
873
+ });
874
+ }).call(this);
875
+ }
876
+ },
532
877
  {
533
878
  key: "onData",
534
879
  value: function onData(chunk) {
@@ -0,0 +1,6 @@
1
+ export type AgentGroup = {
2
+ name: string;
3
+ members: Array<string>;
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,7 @@
1
+ import type { DurableIdentity } from "./DurableIdentity.js";
2
+ export type DurableActiveRun = {
3
+ token: string;
4
+ owner: DurableIdentity;
5
+ provider: DurableIdentity | null;
6
+ startedAt: string;
7
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,18 @@
1
+ import type { DurableActiveRun } from "./DurableActiveRun.js";
2
+ import type { DurableLastResult } from "./DurableLastResult.js";
3
+ export type DurableAgentWire = {
4
+ id: string;
5
+ name: string;
6
+ provider: 'claude' | 'codex' | 'pi';
7
+ mode: 'durable';
8
+ cwd: string;
9
+ providerSessionId: string | null;
10
+ sessionFilePath: string | null;
11
+ state: 'ready' | 'running' | 'degraded';
12
+ sessionHealth: 'uninitialized' | 'healthy' | 'unknown' | 'mismatch';
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ lastActiveAt: string | null;
16
+ activeRun: DurableActiveRun | null;
17
+ lastResult: DurableLastResult | null;
18
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,4 @@
1
+ export type DurableIdentity = {
2
+ pid: number;
3
+ startedAt: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,6 @@
1
+ export type DurableLastResult = {
2
+ status: 'succeeded' | 'failed' | 'interrupted';
3
+ completedAt: string;
4
+ exitCode: number | null;
5
+ summary: string;
6
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,9 @@
1
+ export type DurableRunWire = {
2
+ token: string;
3
+ status: 'running' | 'succeeded' | 'failed' | 'interrupted';
4
+ completedAt: string | null;
5
+ exitCode: number | null;
6
+ summary: string;
7
+ result: string | null;
8
+ stopRequested: boolean;
9
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,4 @@
1
+ export type GroupMemberParams = {
2
+ name: string;
3
+ member: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,4 @@
1
+ export type GroupMembersParams = {
2
+ name: string;
3
+ members: Array<string>;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export { };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Group operations use identifiers, independent of live registrations.
3
+ */
4
+ export type GroupNameParams = {
5
+ name: string;
6
+ };
@@ -0,0 +1,4 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ /**
3
+ * Group operations use identifiers, independent of live registrations.
4
+ */ export { };
package/dist/index.d.ts CHANGED
@@ -10,3 +10,10 @@ export type { AgentRenameResult } from "./gen/AgentRenameResult.js";
10
10
  export type { EnrichedAgent, Event } from "./gen/index.js";
11
11
  export { resolveDaemonBinary } from "./binary.js";
12
12
  export { ensureDaemon } from "./autostart.js";
13
+ export type { DurableCreateParams, DurableLaunchResult, DurableRunDetail, DurableResolution, } from "./client.js";
14
+ export type { DurableAgentWire } from "./gen/DurableAgentWire.js";
15
+ export type { DurableRunWire } from "./gen/DurableRunWire.js";
16
+ export type { AgentGroup } from "./gen/AgentGroup.js";
17
+ export type { GroupNameParams } from "./gen/GroupNameParams.js";
18
+ export type { GroupMembersParams } from "./gen/GroupMembersParams.js";
19
+ export type { GroupMemberParams } from "./gen/GroupMemberParams.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-devkit/daemon-client",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Thin client for the devkitd coordination daemon (unix socket, JSON-RPC, subscribe)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -39,9 +39,9 @@
39
39
  "vitest": "^4.1.8"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@ai-devkit/devkitd-darwin-arm64": "0.4.1",
43
- "@ai-devkit/devkitd-darwin-x64": "0.4.1",
44
- "@ai-devkit/devkitd-linux-arm64": "0.4.1",
45
- "@ai-devkit/devkitd-linux-x64": "0.4.1"
42
+ "@ai-devkit/devkitd-darwin-arm64": "0.5.0",
43
+ "@ai-devkit/devkitd-darwin-x64": "0.5.0",
44
+ "@ai-devkit/devkitd-linux-arm64": "0.5.0",
45
+ "@ai-devkit/devkitd-linux-x64": "0.5.0"
46
46
  }
47
47
  }