Skip to content

Commit

Permalink
Merge pull request #245 from Phuire-Research/Refinement
Browse files Browse the repository at this point in the history
Restored Dialog Functionality
  • Loading branch information
REllEK-IO authored Dec 25, 2024
2 parents 4bed1b6 + 87f6a2f commit 31df8c6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ The direct comparison of Stratimux to an LLM, during runtime these actions are o

### The anatomy of a Stratimux sentence
```
preposition(/+)decision + body + denoter
preposition + body + denoter
example: Finally + Open Muxium + to Notify Subscribers of State changes.
```
This allows for a Stratimux Dialog to be constructed in the same formalization of that of a paragraph. Where the strategy topic is the literal topic sentence of a paragraph. And is followed by all steps and possible decision that create a muxified paragraph.
This allows for a Stratimux Dialog to be constructed in the same formalization of that of a paragraph. Where the strategy topic is the literal topic sentence of a paragraph. And is followed by all steps and possible decisions that formalizes a muxified paragraph when paired with the quality definition.
```
TOPIC + SENTENCE + SENTENCE + SENTENCE
Example:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ When in doubt simplify.
* [Muxified Turing Machine](https://github.com/Phuire-Research/Stratimux/blob/main/The-Muxified-Turing-Machine.md) - The governing concept for this entire framework.:|

## Change Log ![Tests](https://github.com/Phuire-Research/Stratimux/actions/workflows/node.js.yml/badge
### Restored Dialog Functionality 0.2.44
* Moved the handling of the decision action node notes to the consumer function itself.
### QoL 0.2.42
* Broke up complex files into distinguishable parts
* Hooked in deck functionality into method creators properly
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stratimux",
"license": "GPL-3.0",
"version": "0.2.43",
"version": "0.2.44",
"description": "Muxified Turing Machine",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
9 changes: 6 additions & 3 deletions src/model/action/strategy/actionStrategyConsumers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ const strategyConsumer = (
let nextAction: Action<unknown>;
const actionListEntry = createSentence(
strategy.currentNode,
notes,
notes?.preposition ? notes.preposition : defaultPreposition
notes !== undefined ? notes : {preposition: defaultPreposition},
);
if (nextNode !== null) {
const origin = strategy.currentNode.action?.origin;
Expand Down Expand Up @@ -174,13 +173,17 @@ export function strategyFailed(_strategy: ActionStrategy, data?: Record<string,
* strategyDecide(strategy: ActionStrategy, index:number, data?: any)
* Returns the DecisionNode of Index reassigns ActionStrategy to that Action's strategy parameter.
* If no decisionNode is found, will return Conclude instead.
* @param decideKey - Selects from the decisionNodes Dictionary the next Action Node, also acts as the default preposition when assigned
* to your Dialog's Sentence.
* @param data - OPTIONAL, if used will override the ActionStrategy's payload
* @param notes - OPTIONAL, if used will override the current ActionNotes, use this to be specific in regards to your decision.
*/
export const strategyDecide = (
_strategy: ActionStrategy,
decideKey: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data?: Record<string, unknown>,
notes?: ActionNotes
) => {
if (_strategy.currentNode.decisionNodes) {
const decisionNodes = _strategy.currentNode.decisionNodes as Record<string, ActionNode>;
Expand All @@ -192,7 +195,7 @@ export const strategyDecide = (
_strategy,
nextNode,
decideKey,
_strategy.currentNode.decisionNotes,
notes ? notes : _strategy.currentNode.decisionNotes,
data
);
}
Expand Down
9 changes: 4 additions & 5 deletions src/model/action/strategy/actionStrategyHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ export function isNotPunctuated(str: string): boolean {
return notPunctuated;
}

export function createSentence(actionNode: ActionNode, actionNotes?: ActionNotes , decisionKey?: string): string {
const preposition = actionNotes?.preposition ? `${actionNotes.preposition} ` : '';
const decision = decisionKey ? `${decisionKey} ` : '';
export function createSentence(actionNode: ActionNode, actionNotes?: ActionNotes): string {
const preposition = actionNotes?.preposition !== undefined ? `${actionNotes.preposition} ` : '';
const body = `${actionNode.actionType}`;
let denoter = '.';
if (actionNotes?.denoter) {
if (actionNotes?.denoter !== undefined) {
if (isNotPunctuated(actionNotes.denoter)) {
denoter = ` ${actionNotes.denoter}`;
} else {
denoter = actionNotes.denoter;
}
}
return preposition + decision + body + denoter;
return preposition + body + denoter;
}

/*#>*/

0 comments on commit 31df8c6

Please sign in to comment.