fix(shared): add task_system resolver
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -72,3 +72,4 @@ export * from "./plugin-command-discovery"
|
||||
export { SessionCategoryRegistry } from "./session-category-registry"
|
||||
export * from "./plugin-identity"
|
||||
export * from "./log-legacy-plugin-startup-warning"
|
||||
export * from "./task-system-enabled"
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import { isTaskSystemEnabled } from "./task-system-enabled"
|
||||
|
||||
describe("isTaskSystemEnabled", () => {
|
||||
describe("#given experimental.task_system is omitted", () => {
|
||||
test("#when resolving #then it defaults to false", () => {
|
||||
// given
|
||||
const config = {}
|
||||
|
||||
// when
|
||||
const result = isTaskSystemEnabled(config)
|
||||
|
||||
// then
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given experimental.task_system is enabled", () => {
|
||||
test("#when resolving #then it returns true", () => {
|
||||
// given
|
||||
const config = { experimental: { task_system: true } }
|
||||
|
||||
// when
|
||||
const result = isTaskSystemEnabled(config)
|
||||
|
||||
// then
|
||||
expect(result).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given experimental.task_system is disabled", () => {
|
||||
test("#when resolving #then it returns false", () => {
|
||||
// given
|
||||
const config = { experimental: { task_system: false } }
|
||||
|
||||
// when
|
||||
const result = isTaskSystemEnabled(config)
|
||||
|
||||
// then
|
||||
expect(result).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface TaskSystemConfig {
|
||||
experimental?: {
|
||||
task_system?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export function isTaskSystemEnabled(config: TaskSystemConfig): boolean {
|
||||
return config.experimental?.task_system ?? false
|
||||
}
|
||||
Reference in New Issue
Block a user