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
25 changes: 20 additions & 5 deletions src/functions/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
//
// Named callables a `script` flow node resolves by name at run time. A flow
// function is PURE: it takes `input` and RETURNS a value; a later declarative
// node persists it. Add yours to this map — the map itself is already wired
// into objectstack.config.ts, so no feature branch needs to touch the config.
// Named callables the platform resolves BY NAME at run time — a `script` flow
// node's function, and a `defineJob`'s `handler`. Both are read from the same
// place: `collectBundleFunctions(bundle)` over `defineStack({ functions })`.
// Add yours to this map — the map itself is already wired into
// objectstack.config.ts, so no feature branch needs to touch the config.
//
// A flow-node function is PURE: it takes `input` and RETURNS a value, and a
// later declarative node persists it. A function that legitimately writes
// DECLARES it (`{ handler, effect: 'writes' }`) so a run reports
// `unmeasuredEffect` rather than claiming it wrote nothing.

import { DISPATCH_HANDLER_NAME, dulyDispatch } from '../jobs/dispatch.job.js';

export const dulyFunctions = {};
export const dulyFunctions = {
// The dispatch job's handler. Declared `writes` because it does: it inserts
// `duly_task` rows directly rather than returning a value for a declarative
// node to persist. That is the honest declaration for a JOB handler, which
// has no flow graph around it to do the writing — see the note on data reach
// in `src/jobs/dispatch.job.ts`.
[DISPATCH_HANDLER_NAME]: { handler: dulyDispatch, effect: 'writes' as const },
};
Loading
Loading