MCPcopy Index your code
hub / github.com/github/copilot-sdk / toSessionMetadata

Method toSessionMetadata

nodejs/src/client.ts:2006–2030  ·  view source on GitHub ↗
(raw: {
        sessionId: string;
        startTime: string;
        modifiedTime: string;
        summary?: string;
        isRemote: boolean;
        context?: { cwd: string; gitRoot?: string; repository?: string; branch?: string };
    })

Source from the content-addressed store, hash-verified

2004 }
2005
2006 private static toSessionMetadata(raw: {
2007 sessionId: string;
2008 startTime: string;
2009 modifiedTime: string;
2010 summary?: string;
2011 isRemote: boolean;
2012 context?: { cwd: string; gitRoot?: string; repository?: string; branch?: string };
2013 }): SessionMetadata {
2014 const { context } = raw;
2015 return {
2016 sessionId: raw.sessionId,
2017 startTime: new Date(raw.startTime),
2018 modifiedTime: new Date(raw.modifiedTime),
2019 summary: raw.summary,
2020 isRemote: raw.isRemote,
2021 context: context
2022 ? {
2023 workingDirectory: context.cwd,
2024 gitRoot: context.gitRoot,
2025 repository: context.repository,
2026 branch: context.branch,
2027 }
2028 : undefined,
2029 };
2030 }
2031
2032 /**
2033 * Gets the foreground session ID in TUI+server mode.

Callers 1

getSessionMetadataMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected