adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
32 lines (31 loc) • 844 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReadonlyContext = void 0;
/**
* Readonly context for agent invocations.
* Provides read-only access to the agent's state and context.
*/
class ReadonlyContext {
constructor(invocationContext) {
this.invocationContext = invocationContext;
}
/**
* The current invocation id.
*/
get invocationId() {
return this.invocationContext.invocationId;
}
/**
* The name of the agent that is currently running.
*/
get agentName() {
return this.invocationContext.agent.name;
}
/**
* The state of the current session. READONLY field.
*/
get state() {
return Object.freeze({ ...this.invocationContext.session.state });
}
}
exports.ReadonlyContext = ReadonlyContext;