mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 04:54:25 -07:00
feat: add /features command and lifecycle visibility
This commit is contained in:
@@ -67,6 +67,18 @@ export interface FeatureSpec {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* FeatureInfo provides a summary of a feature's current state and metadata.
|
||||
*/
|
||||
export interface FeatureInfo {
|
||||
key: string;
|
||||
enabled: boolean;
|
||||
stage: FeatureStage;
|
||||
since?: string;
|
||||
until?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* FeatureGate provides a read-only interface to query feature status.
|
||||
*/
|
||||
@@ -79,6 +91,10 @@ export interface FeatureGate {
|
||||
* Returns all known feature keys.
|
||||
*/
|
||||
knownFeatures(): string[];
|
||||
/**
|
||||
* Returns all features with their status and metadata.
|
||||
*/
|
||||
getFeatureInfo(): FeatureInfo[];
|
||||
/**
|
||||
* Returns a mutable copy of the current gate.
|
||||
*/
|
||||
@@ -189,6 +205,22 @@ class FeatureGateImpl implements MutableFeatureGate {
|
||||
return Array.from(this.specs.keys());
|
||||
}
|
||||
|
||||
getFeatureInfo(): FeatureInfo[] {
|
||||
return Array.from(this.specs.entries())
|
||||
.map(([key, specs]) => {
|
||||
const latestSpec = specs[specs.length - 1];
|
||||
return {
|
||||
key,
|
||||
enabled: this.enabled(key),
|
||||
stage: latestSpec.preRelease,
|
||||
since: latestSpec.since,
|
||||
until: latestSpec.until,
|
||||
description: latestSpec.description,
|
||||
};
|
||||
})
|
||||
.sort((a, b) => a.key.localeCompare(b.key));
|
||||
}
|
||||
|
||||
deepCopy(): MutableFeatureGate {
|
||||
const copy = new FeatureGateImpl();
|
||||
copy.specs = new Map(
|
||||
|
||||
Reference in New Issue
Block a user