@persistmemory/sdk 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/index.cjs +25 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +25 -0
- package/dist/index.js.map +2 -2
- package/dist/resources/agent.d.ts +22 -1
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient, RequestOptions } from "../http.js";
|
|
2
|
-
import type { AgentDownloadLink, AgentRequest } from "../types.js";
|
|
2
|
+
import type { AgentDownloadLink, AgentRequest, AgentRequestList, MachineShareResult } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Files fetched from the caller's own machine.
|
|
5
5
|
*
|
|
@@ -29,4 +29,25 @@ export declare class Agent {
|
|
|
29
29
|
* object, it expires in minutes, and it should not be logged or stored.
|
|
30
30
|
*/
|
|
31
31
|
downloadLink(id: string, options?: RequestOptions): Promise<AgentDownloadLink>;
|
|
32
|
+
/**
|
|
33
|
+
* A Space's requests — what the project has in flight and what came back,
|
|
34
|
+
* whoever raised it and whichever machine answered. For an editor or owner
|
|
35
|
+
* of the Space; a viewer, and anybody not in it, is answered 404.
|
|
36
|
+
*/
|
|
37
|
+
spaceRequests(spaceId: string, options?: RequestOptions): Promise<AgentRequestList>;
|
|
38
|
+
/**
|
|
39
|
+
* Shares one of your own machines into a Space, so the Space's editors can
|
|
40
|
+
* ask it for files and commands. Every such ask waits for you, the
|
|
41
|
+
* machine's owner, whatever your own approval settings say. Session
|
|
42
|
+
* credentials only.
|
|
43
|
+
*/
|
|
44
|
+
shareMachine(args: {
|
|
45
|
+
hostname: string;
|
|
46
|
+
space: string;
|
|
47
|
+
}, options?: RequestOptions): Promise<MachineShareResult>;
|
|
48
|
+
/** Takes a machine back out of a Space. Requests already answered stay answered. */
|
|
49
|
+
unshareMachine(args: {
|
|
50
|
+
hostname: string;
|
|
51
|
+
space: string;
|
|
52
|
+
}, options?: RequestOptions): Promise<MachineShareResult>;
|
|
32
53
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -616,6 +616,10 @@ export interface UpdateIntegrationParams {
|
|
|
616
616
|
/** A file asked of one of the caller's own machines. */
|
|
617
617
|
export interface AgentRequest {
|
|
618
618
|
readonly id: string;
|
|
619
|
+
/** The requester. The answer lands in their chat, whichever machine answered. */
|
|
620
|
+
readonly userId?: string;
|
|
621
|
+
/** The Space the request was raised in, when it was raised from inside one. */
|
|
622
|
+
readonly spaceId?: string;
|
|
619
623
|
readonly surface: string;
|
|
620
624
|
readonly kind: string;
|
|
621
625
|
/** The path that was asked for, on the machine that was asked. */
|
|
@@ -633,6 +637,17 @@ export interface AgentRequest {
|
|
|
633
637
|
readonly error?: string;
|
|
634
638
|
readonly createdAt: string;
|
|
635
639
|
readonly completedAt?: string;
|
|
640
|
+
/** Who said yes: the requester, or the owner of the machine it ran on. */
|
|
641
|
+
readonly approvedBy?: string;
|
|
642
|
+
}
|
|
643
|
+
/** A Space's requests, newest first. */
|
|
644
|
+
export interface AgentRequestList {
|
|
645
|
+
readonly items: readonly AgentRequest[];
|
|
646
|
+
}
|
|
647
|
+
/** What sharing or withdrawing a machine came to, in a sentence for the person. */
|
|
648
|
+
export interface MachineShareResult {
|
|
649
|
+
readonly ok: boolean;
|
|
650
|
+
readonly note: string;
|
|
636
651
|
}
|
|
637
652
|
export interface AgentDownloadLink {
|
|
638
653
|
/**
|