refactor(core): rename system context to instructions (#35583)
This commit is contained in:
parent
1a52e1118e
commit
91f1815732
62 changed files with 1482 additions and 1005 deletions
20
packages/schema/src/instruction-entry.ts
Normal file
20
packages/schema/src/instruction-entry.ts
Normal 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> {}
|
||||
|
|
@ -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> {}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue