Skip to content

Commit 50bccfc

Browse files
cemreyukselclaude
andcommitted
feat: update AI action invocation variable types to sys-nested format
Reference variables now use the standard sys-nested link structure with type, linkType, id, optional release, and optional entityPaths inside sys, instead of flat entityId/entityType/entityPath(s) properties. Extracts AiActionInvocationVariable as a reusable exported type. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5f3e49c commit 50bccfc

3 files changed

Lines changed: 42 additions & 22 deletions

File tree

lib/common-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ import type { AiActionProps, AiActionQueryOptions, CreateAiActionProps } from '.
193193
import type {
194194
AiActionInvocationProps,
195195
AiActionInvocationType,
196+
AiActionInvocationVariable,
196197
} from './entities/ai-action-invocation'
197198
import type { AgentGeneratePayload, AgentProps } from './entities/agent'
198199
import type {

lib/entities/ai-action-invocation.ts

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,45 @@ export type AiActionInvocationProps = {
4949
result?: InvocationResult
5050
}
5151

52-
export type AiActionInvocationType = {
53-
outputFormat?: 'RichText' | 'Markdown' | 'PlainText'
54-
variables?: Array<
55-
| {
56-
value: string
57-
id: string
58-
}
59-
| {
60-
value: {
61-
entityPath: string
62-
entityType: 'Entry' | 'Asset' | 'ResourceLink'
63-
entityId: string
52+
export type AiActionInvocationVariable =
53+
| {
54+
id: string
55+
value: string
56+
}
57+
| {
58+
id: string
59+
value: {
60+
sys: {
61+
type: 'Link'
62+
linkType: 'Entry' | 'Asset'
63+
id: string
64+
release?: SysLink
65+
entityPaths?: Array<string>
6466
}
65-
id: string
6667
}
67-
| {
68-
value: {
69-
entityPaths: Array<string>
70-
entityType: 'Entry'
71-
entityId: string
72-
}
73-
id: string
68+
}
69+
| /** @deprecated Use the sys-nested format instead. */
70+
{
71+
id: string
72+
value: {
73+
entityPath: string
74+
entityType: 'Entry' | 'Asset' | 'ResourceLink'
75+
entityId: string
7476
}
75-
>
77+
}
78+
| /** @deprecated Use the sys-nested format instead. */
79+
{
80+
id: string
81+
value: {
82+
entityPaths: Array<string>
83+
entityType: 'Entry'
84+
entityId: string
85+
}
86+
}
87+
88+
export type AiActionInvocationType = {
89+
outputFormat?: 'RichText' | 'Markdown' | 'PlainText'
90+
variables?: Array<AiActionInvocationVariable>
7691
}
7792

7893
/**

lib/export-types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export type {
1313
CreateAppAccessTokenProps,
1414
} from './entities/app-access-token'
1515
export type { AiAction, AiActionProps, CreateAiActionProps } from './entities/ai-action'
16-
export type { AiActionInvocation, AiActionInvocationProps } from './entities/ai-action-invocation'
16+
export type {
17+
AiActionInvocation,
18+
AiActionInvocationProps,
19+
AiActionInvocationVariable,
20+
} from './entities/ai-action-invocation'
1721
export type { Agent, AgentGeneratePayload, AgentProps, AgentToolLink } from './entities/agent'
1822
export type {
1923
AgentGenerateResponse,

0 commit comments

Comments
 (0)