Skip to content

An open-source, faster Devin alternative

TypeScript

computer: Session.aside in the public schema, false in the computer's fold

Igor Zalutski via Computer42e7be78c26d
diff --git a/computer/schema/computer-api.v1.json b/computer/schema/computer-api.v1.json
index c298a004..748f5a9e 100644
--- a/computer/schema/computer-api.v1.json
+++ b/computer/schema/computer-api.v1.json
@@ -2676,6 +2676,9 @@
"archived": {
"type": "boolean"
},
+ "aside": {
+ "type": "boolean"
+ },
"owner": {
"$ref": "#/$defs/Person"
},
@@ -2837,6 +2840,7 @@
"title",
"status",
"archived",
+ "aside",
"owner",
"origin",
"settings",
diff --git a/computer/src/api/fold.test.ts b/computer/src/api/fold.test.ts
index 6ac842a2..754a95f5 100644
--- a/computer/src/api/fold.test.ts
+++ b/computer/src/api/fold.test.ts
@@ -86,7 +86,8 @@ describe('Fold', () => {
it('session.updated changes settings, title, archive and metadata keys', () => {
const { fold, add } = feed();
add('session.updated', { changes: { title: { from: '', to: 'T' }, model: { from: null, to: 'm2' }, archived: { from: false, to: true }, 'metadata.k': { from: null, to: 'v' } } });
- expect(fold.session()).toMatchObject({ title: 'T', archived: true, settings: { model: 'm2' }, metadata: { k: 'v' } });
+ // Set aside is the server's column, never journaled: the computer's fold always says false.
+ expect(fold.session()).toMatchObject({ title: 'T', archived: true, aside: false, settings: { model: 'm2' }, metadata: { k: 'v' } });
add('session.updated', { changes: { 'metadata.k': { from: 'v', to: null } } });
expect(fold.session().metadata).toEqual({});
});
diff --git a/computer/src/api/fold.ts b/computer/src/api/fold.ts
index 250a483c..29960ccb 100644
--- a/computer/src/api/fold.ts
+++ b/computer/src/api/fold.ts
@@ -377,6 +377,7 @@ export class Fold {
title: this.title,
status: this.sessionStatus,
archived: this.archived,
+ aside: false, // the server's: a column on its session row, never journaled
owner: { ...this.seed.owner },
origin: structuredClone(this.origin),
settings: { ...this.settings },
diff --git a/computer/src/api/schema-objects.ts b/computer/src/api/schema-objects.ts
index 8fdf36bc..882acad8 100644
--- a/computer/src/api/schema-objects.ts
+++ b/computer/src/api/schema-objects.ts
@@ -197,6 +197,8 @@ export const Session = Schema.Struct({
title: Schema.String,
status: SessionStatus,
archived: Schema.Boolean,
+ /** Set aside by its owner in triage, until something newer needs them. The server's; a computer's own fold says false. */
+ aside: Schema.Boolean,
owner: Person,
origin: Origin,
settings: Settings,