diff options
| author | Dax Raad <[email protected]> | 2025-05-17 21:31:42 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-26 12:40:17 -0400 |
| commit | a34d020bc6b252e842f042d935c7a0e6444460cf (patch) | |
| tree | ea3484499dff80e82d421e879ab639133ae9c3b4 /js/src/session | |
| parent | 96fbc37f0175052291f8a096d530bd4480f6cb19 (diff) | |
| download | opencode-a34d020bc6b252e842f042d935c7a0e6444460cf.tar.gz opencode-a34d020bc6b252e842f042d935c7a0e6444460cf.zip | |
sync
Diffstat (limited to 'js/src/session')
| -rw-r--r-- | js/src/session/session.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/session/session.ts b/js/src/session/session.ts new file mode 100644 index 000000000..0925584de --- /dev/null +++ b/js/src/session/session.ts @@ -0,0 +1,22 @@ +import { Identifier } from "../id/id"; +import { Storage } from "../storage/storage"; +import { Log } from "../util/log"; + +export namespace Session { + const log = Log.create({ service: "session" }); + + export interface Info { + id: string; + title: string; + } + + export async function create() { + const result: Info = { + id: Identifier.create("session"), + title: "New Session - " + new Date().toISOString(), + }; + log.info("created", result); + await Storage.write("session/info/" + result.id, JSON.stringify(result)); + return result; + } +} |
