Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/sim/scripts/check-block-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,18 @@ function checkCanonicalIdContract(): CheckResult {
const access: string[] = block.tools?.access ?? []
if (access.length === 0) continue

// A subBlock with `canonicalParamId` has its raw `id` deleted from `params` during
// canonical-group resolution in `extractParams` (serializer/index.ts), so the raw id is
// NOT a valid lookup key at execution time — only the canonical is. Tool params must
// align with the canonical, not the raw id.
const subBlockKeys = new Set<string>()
for (const sb of block.subBlocks ?? []) {
if (sb.id) subBlockKeys.add(sb.id)
const canonical = (sb as { canonicalParamId?: string }).canonicalParamId
if (canonical) subBlockKeys.add(canonical)
if (canonical) {
subBlockKeys.add(canonical)
} else if (sb.id) {
subBlockKeys.add(sb.id)
}
}

for (const toolId of access) {
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/tools/posthog/delete_person.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ToolConfig } from '@/tools/types'

export interface PostHogDeletePersonParams {
personalApiKey: string
apiKey: string
region?: 'us' | 'eu'
projectId: string
personId: string
Expand All @@ -23,7 +23,7 @@ export const deletePersonTool: ToolConfig<PostHogDeletePersonParams, PostHogDele
version: '1.0.0',

params: {
personalApiKey: {
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
Expand Down Expand Up @@ -57,7 +57,7 @@ export const deletePersonTool: ToolConfig<PostHogDeletePersonParams, PostHogDele
},
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.personalApiKey}`,
Authorization: `Bearer ${params.apiKey}`,
'Content-Type': 'application/json',
}),
},
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/tools/posthog/get_person.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ToolConfig } from '@/tools/types'

export interface PostHogGetPersonParams {
personalApiKey: string
apiKey: string
region?: 'us' | 'eu'
projectId: string
personId: string
Expand All @@ -28,7 +28,7 @@ export const getPersonTool: ToolConfig<PostHogGetPersonParams, PostHogGetPersonR
version: '1.0.0',

params: {
personalApiKey: {
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
Expand Down Expand Up @@ -62,7 +62,7 @@ export const getPersonTool: ToolConfig<PostHogGetPersonParams, PostHogGetPersonR
},
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.personalApiKey}`,
Authorization: `Bearer ${params.apiKey}`,
'Content-Type': 'application/json',
}),
},
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/tools/posthog/list_persons.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ToolConfig } from '@/tools/types'

export interface PostHogListPersonsParams {
personalApiKey: string
apiKey: string
region?: 'us' | 'eu'
projectId: string
limit?: number
Expand Down Expand Up @@ -35,7 +35,7 @@ export const listPersonsTool: ToolConfig<PostHogListPersonsParams, PostHogListPe
version: '1.0.0',

params: {
personalApiKey: {
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
Expand Down Expand Up @@ -95,7 +95,7 @@ export const listPersonsTool: ToolConfig<PostHogListPersonsParams, PostHogListPe
},
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.personalApiKey}`,
Authorization: `Bearer ${params.apiKey}`,
'Content-Type': 'application/json',
}),
},
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/tools/posthog/query.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ToolConfig } from '@/tools/types'

export interface PostHogQueryParams {
personalApiKey: string
apiKey: string
region?: 'us' | 'eu'
projectId: string
query: string
Expand All @@ -27,7 +27,7 @@ export const queryTool: ToolConfig<PostHogQueryParams, PostHogQueryResponse> = {
version: '1.0.0',

params: {
personalApiKey: {
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
Expand Down Expand Up @@ -69,7 +69,7 @@ export const queryTool: ToolConfig<PostHogQueryParams, PostHogQueryResponse> = {
},
method: 'POST',
headers: (params) => ({
Authorization: `Bearer ${params.personalApiKey}`,
Authorization: `Bearer ${params.apiKey}`,
'Content-Type': 'application/json',
}),
body: (params) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/posthog/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface PostHogPublicParams extends PostHogBaseParams {
}

export interface PostHogPrivateParams extends PostHogBaseParams {
personalApiKey: string
apiKey: string
projectId: string
}

Expand Down
Loading