Skip to content

Add class registering way of registering stuff#21

Open
Knerio wants to merge 5 commits intomainfrom
20-add-new-way-of-registering-functions
Open

Add class registering way of registering stuff#21
Knerio wants to merge 5 commits intomainfrom
20-add-new-way-of-registering-functions

Conversation

@Knerio
Copy link
Copy Markdown
Member

@Knerio Knerio commented Apr 7, 2026

close #20

@Knerio Knerio requested a review from nicosammito April 7, 2026 20:15
@Knerio Knerio self-assigned this Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/hercules/-/pipelines/2442426504

Status: Passed
Duration: 1 minutes

Job summaries

docs:preview

Documentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/13858219905/artifacts/out/index.html

Knerio and others added 2 commits April 9, 2026 20:30
Co-authored-by: Nico Sammito <nsammito@code0.tech>
Signed-off-by: Dario Pranjic <96529060+Knerio@users.noreply.github.com>
@Knerio Knerio force-pushed the 20-add-new-way-of-registering-functions branch from d25c501 to 52d7868 Compare April 9, 2026 19:08
@Knerio Knerio requested a review from nicosammito April 9, 2026 19:32
Copy link
Copy Markdown
Member

@nicosammito nicosammito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdk is in generally really confusing and it's hard to understand what and when something is happening.

RuntimeErrorException, RuntimeParameter, Signature
} from "@code0-tech/hercules";

const sdk = createSdk({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All those settings besides the version should be within a .env file

runtimeName: "number",
defaultValue: 20
})
class FibonacciFunction {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All implementations should be outsourced to a separate file. Also for data types and flow types

@@ -0,0 +1,18 @@
import { defineConfig } from 'vite';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing in package.json

build: {
target: "node18",
ssr: resolve(__dirname, 'index.ts'), // ✅ correct SSR entry
rollupOptions: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is deprecated

@@ -20,9 +24,9 @@ export interface HerculesFunctionContext {

export interface HerculesDataType {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version is generally not overrideable. It always is the SDK version number

}
state.stream = state.client.transfer(builtOptions);

await handleDataTypes(state, builtOptions, config);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we handle the DataTypes before Logon?


return new Promise(async (resolve, reject) => {
try {
for await (let message of state?.stream?.responses || []) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont use let

import {constructValue, toAllowedValue} from "@code0-tech/tucana/helpers";
import {logger} from "./logger";
import 'reflect-metadata';
import {connect as connectHelper} from "./sdk/connection/connection";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really confusing. Just dont use alias imports

import {registerRuntimeFunctionDefinitionClass} from "./builder/registerRuntimeFunctionDefinitionClass";


const createSdk = (config: ActionSdk["config"], configDefinitions?: HerculesActionConfigurationDefinition[]): ActionSdk => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using EventEmitter in general for js based communication?

import {buildRuntimeFunctionDefinition} from "./builder";
import {constructValue} from "@code0-tech/tucana/helpers";

export function registerFunctionDefinitionClass(config: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do I need to provide a config to register a function Definition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new way of registering functions

2 participants