@persistmemory/sdk 0.3.0 → 0.4.1
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/README.md +17 -8
- package/dist/index.cjs +52 -10
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +52 -10
- package/dist/index.js.map +2 -2
- package/dist/resources/spaces.d.ts +37 -12
- package/dist/types.d.ts +44 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -613,6 +613,14 @@ var Spaces = class {
|
|
|
613
613
|
* `delete` never destroys a memory that is filed in another Space as well —
|
|
614
614
|
* that one is detached and left alone. `deleted` and `kept` come back so you
|
|
615
615
|
* can say what actually happened.
|
|
616
|
+
*
|
|
617
|
+
* `moveTo` NAMES WHERE THE STRANDED ONES GO, and is refused-into rather than
|
|
618
|
+
* required: most deletions strand nothing, because everything in the Space
|
|
619
|
+
* is also filed elsewhere, and demanding a destination for those would be a
|
|
620
|
+
* question about nothing. When something WOULD be left in no Space at all,
|
|
621
|
+
* the server answers 400 naming this field. It used to file them into the
|
|
622
|
+
* account's default, which no longer exists — nothing picks a Space on
|
|
623
|
+
* anybody's behalf, so "keep these" has no answer unless you say where.
|
|
616
624
|
*/
|
|
617
625
|
async delete(id, params, options) {
|
|
618
626
|
return this.#http.delete(
|
|
@@ -636,21 +644,55 @@ var Spaces = class {
|
|
|
636
644
|
options
|
|
637
645
|
);
|
|
638
646
|
}
|
|
647
|
+
/* ------------------------- where this is working ------------------------- */
|
|
648
|
+
/*
|
|
649
|
+
`getDefault` AND `setDefault` ARE GONE, with the endpoints they called.
|
|
650
|
+
|
|
651
|
+
They read and wrote the account-wide Space a capture fell into when nobody
|
|
652
|
+
named one. Nothing falls anywhere now: a Space is chosen for the context
|
|
653
|
+
doing the capturing, or `remember` answers 400. Keeping the methods would
|
|
654
|
+
mean keeping two calls that 404, which is a worse break than removing them
|
|
655
|
+
because it looks like a server fault rather than a change.
|
|
656
|
+
*/
|
|
639
657
|
/**
|
|
640
|
-
*
|
|
658
|
+
* Which Space a context is working in.
|
|
659
|
+
*
|
|
660
|
+
* `chosen` absent means NOTHING sent from that context is kept — there is no
|
|
661
|
+
* default behind it and nothing picks one. The reply used to carry a
|
|
662
|
+
* `fallback` for that case and no longer can.
|
|
641
663
|
*
|
|
642
|
-
* `
|
|
643
|
-
*
|
|
644
|
-
*
|
|
664
|
+
* `profile` is the command line's own profile name, and `surface` says which
|
|
665
|
+
* context is being asked about: `cli` for this profile, `email` for the
|
|
666
|
+
* account's ingest address. Between them they are the whole of what a caller
|
|
667
|
+
* may say about where it is working — the server builds the scope key
|
|
668
|
+
* itself, so this can never read or move where a chat is filing.
|
|
645
669
|
*/
|
|
646
|
-
async
|
|
647
|
-
return this.#http.get(
|
|
670
|
+
async working(params = {}, options) {
|
|
671
|
+
return this.#http.get(
|
|
672
|
+
"/api/v1/spaces/working",
|
|
673
|
+
{
|
|
674
|
+
...params.profile !== void 0 ? { profile: params.profile } : {},
|
|
675
|
+
...params.surface !== void 0 ? { surface: params.surface } : {}
|
|
676
|
+
},
|
|
677
|
+
options
|
|
678
|
+
);
|
|
648
679
|
}
|
|
649
|
-
/**
|
|
650
|
-
|
|
680
|
+
/**
|
|
681
|
+
* Works in one from here on. `null` stops working in any.
|
|
682
|
+
*
|
|
683
|
+
* Takes an id or a NAME, because that is how a person says it. `null` rather
|
|
684
|
+
* than an omitted field: "clear this" and "I did not mention it" are
|
|
685
|
+
* different instructions, and clearing means this context keeps nothing
|
|
686
|
+
* until a Space is chosen again.
|
|
687
|
+
*/
|
|
688
|
+
async chooseWorking(space, params = {}, options) {
|
|
651
689
|
return this.#http.patch(
|
|
652
|
-
"/api/v1/spaces/
|
|
653
|
-
{
|
|
690
|
+
"/api/v1/spaces/working",
|
|
691
|
+
{
|
|
692
|
+
space,
|
|
693
|
+
...params.profile !== void 0 ? { profile: params.profile } : {},
|
|
694
|
+
...params.surface !== void 0 ? { surface: params.surface } : {}
|
|
695
|
+
},
|
|
654
696
|
options
|
|
655
697
|
);
|
|
656
698
|
}
|