MCPcopy
hub / github.com/anomalyco/opencode / workspaceInfo

Function workspaceInfo

packages/opencode/test/control-plane/workspace.test.ts:267–278  ·  view source on GitHub ↗
(projectID: ProjectV2.ID, type: string, input?: Partial<Workspace.Info>)

Source from the content-addressed store, hash-verified

265}
266
267function workspaceInfo(projectID: ProjectV2.ID, type: string, input?: Partial<Workspace.Info>): Workspace.Info {
268 return {
269 id: input?.id ?? WorkspaceV2.ID.ascending(),
270 type,
271 name: input?.name ?? unique("workspace"),
272 branch: input?.branch ?? null,
273 directory: input?.directory ?? null,
274 extra: input?.extra ?? null,
275 projectID,
276 timeUsed: input?.timeUsed ?? Date.now(),
277 }
278}
279
280function insertWorkspace(info: Workspace.Info) {
281 return Database.Service.use(({ db }) =>

Callers 2

SettingsSectionFunction · 0.85
workspace.test.tsFile · 0.85

Calls 1

uniqueFunction · 0.70

Tested by

no test coverage detected