refactor(core): rename system context to instructions (#35583)

This commit is contained in:
Kit Langton 2026-07-06 14:29:29 -04:00 committed by GitHub
commit 91f1815732
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 1482 additions and 1005 deletions

View file

@ -0,0 +1,20 @@
export * as InstructionEntry from "./instruction-entry.js"
import { Schema } from "effect"
/**
* Slash-free client-facing key for one API-managed instruction entry. The server
* derives the namespaced Instructions key as `api/<key>`, keeping the
* `api/*` namespace enforced by construction.
*/
export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*$/)).annotate({
identifier: "InstructionEntry.Key",
description: "Instruction entry key (lowercase alphanumerics plus . _ -)",
})
export type Key = typeof Key.Type
export const Info = Schema.Struct({
key: Key,
value: Schema.Json.annotate({ description: "JSON value attached to the session's instructions" }),
}).annotate({ identifier: "InstructionEntry.Info" })
export interface Info extends Schema.Schema.Type<typeof Info> {}

View file

@ -1,20 +0,0 @@
export * as SessionContextEntry from "./session-context-entry.js"
import { Schema } from "effect"
/**
* Slash-free client-facing key for one API-managed context entry. The server
* derives the namespaced SystemContext key as `api/<key>`, keeping the
* `api/*` namespace enforced by construction.
*/
export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*$/)).annotate({
identifier: "SessionContextEntry.Key",
description: "Context entry key (lowercase alphanumerics plus . _ -)",
})
export type Key = typeof Key.Type
export const Info = Schema.Struct({
key: Key,
value: Schema.Json.annotate({ description: "JSON value attached to the session's system context" }),
}).annotate({ identifier: "SessionContextEntry.Info" })
export interface Info extends Schema.Schema.Type<typeof Info> {}

View file

@ -130,15 +130,15 @@ export const ExecutionSettled = Event.ephemeral({
})
export type ExecutionSettled = typeof ExecutionSettled.Type
export const ContextUpdated = Event.durable({
type: "session.context.updated",
export const InstructionsUpdated = Event.durable({
type: "session.instructions.updated",
...options,
schema: {
...Base,
text: Schema.String,
},
})
export type ContextUpdated = typeof ContextUpdated.Type
export type InstructionsUpdated = typeof InstructionsUpdated.Type
export const Synthetic = Event.durable({
type: "session.synthetic",
@ -494,7 +494,7 @@ export const Definitions = Event.inventory(
PromptPromoted,
PromptAdmitted,
ExecutionSettled,
ContextUpdated,
InstructionsUpdated,
Synthetic,
Skill.Activated,
Shell.Started,