@kradle/challenges-sdk 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -1
- package/LLM_README.md +235 -2340
- package/README.md +151 -571
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/runtime/examples/capture-the-flag.d.ts +33 -0
- package/dist/runtime/examples/capture-the-flag.d.ts.map +1 -0
- package/dist/runtime/examples/capture-the-flag.js +79 -0
- package/dist/runtime/examples/capture-the-flag.js.map +1 -0
- package/dist/runtime/examples/climb.d.ts +34 -0
- package/dist/runtime/examples/climb.d.ts.map +1 -0
- package/dist/runtime/examples/climb.js +54 -0
- package/dist/runtime/examples/climb.js.map +1 -0
- package/dist/runtime/examples/four-bridges.d.ts +107 -0
- package/dist/runtime/examples/four-bridges.d.ts.map +1 -0
- package/dist/runtime/examples/four-bridges.js +294 -0
- package/dist/runtime/examples/four-bridges.js.map +1 -0
- package/dist/runtime/examples/herding.d.ts +59 -0
- package/dist/runtime/examples/herding.d.ts.map +1 -0
- package/dist/runtime/examples/herding.js +181 -0
- package/dist/runtime/examples/herding.js.map +1 -0
- package/dist/runtime/examples/skywars.d.ts +116 -0
- package/dist/runtime/examples/skywars.d.ts.map +1 -0
- package/dist/runtime/examples/skywars.js +253 -0
- package/dist/runtime/examples/skywars.js.map +1 -0
- package/dist/runtime/harness.d.ts +176 -0
- package/dist/runtime/harness.d.ts.map +1 -0
- package/dist/runtime/harness.js +441 -0
- package/dist/runtime/harness.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +18 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/sandbox-registry.d.ts +7 -0
- package/dist/runtime/sandbox-registry.d.ts.map +1 -0
- package/dist/runtime/sandbox-registry.js +16 -0
- package/dist/runtime/sandbox-registry.js.map +1 -0
- package/dist/runtime/sandbox.d.ts +29 -0
- package/dist/runtime/sandbox.d.ts.map +1 -0
- package/dist/runtime/sandbox.js +70 -0
- package/dist/runtime/sandbox.js.map +1 -0
- package/dist/runtime/sdk.d.ts +1038 -0
- package/dist/runtime/sdk.d.ts.map +1 -0
- package/dist/runtime/sdk.js +1271 -0
- package/dist/runtime/sdk.js.map +1 -0
- package/dist/runtime/world.d.ts +141 -0
- package/dist/runtime/world.d.ts.map +1 -0
- package/dist/runtime/world.js +344 -0
- package/dist/runtime/world.js.map +1 -0
- package/package.json +76 -39
- package/dist/actions.d.ts +0 -901
- package/dist/actions.d.ts.map +0 -1
- package/dist/actions.js +0 -1155
- package/dist/actions.js.map +0 -1
- package/dist/api_utils.d.ts +0 -25
- package/dist/api_utils.d.ts.map +0 -1
- package/dist/api_utils.js +0 -48
- package/dist/api_utils.js.map +0 -1
- package/dist/challenge.d.ts +0 -58
- package/dist/challenge.d.ts.map +0 -1
- package/dist/challenge.js +0 -578
- package/dist/challenge.js.map +0 -1
- package/dist/commands.d.ts +0 -57
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -200
- package/dist/commands.js.map +0 -1
- package/dist/constants.d.ts +0 -72
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -109
- package/dist/constants.js.map +0 -1
- package/dist/testmode.d.ts +0 -3
- package/dist/testmode.d.ts.map +0 -1
- package/dist/testmode.js +0 -19
- package/dist/testmode.js.map +0 -1
- package/dist/types.d.ts +0 -197
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -38
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -17
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -22
- package/dist/utils.js.map +0 -1
package/dist/types.d.ts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import type { Score, SelectorClass } from "sandstone";
|
|
2
|
-
import type { OBJECTIVE_CRITERION } from "sandstone/arguments/generated";
|
|
3
|
-
import type { AdvancementTriggers } from "sandstone/arguments/resources/AdvancementTriggers";
|
|
4
|
-
import type { BUILTIN_VARIABLE_NAMES, POSSIBLE_SCENARIO_EVENTS } from "./constants";
|
|
5
|
-
export { Actions } from "./actions";
|
|
6
|
-
/**
|
|
7
|
-
* Represents a spawn point location, either as explicit coordinates or as an entity selector.
|
|
8
|
-
* When using an entity selector, it should target a single entity (e.g., a location marker).
|
|
9
|
-
*/
|
|
10
|
-
export type SpawnPoint = {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
z: number;
|
|
14
|
-
} | SelectorClass<true, false>;
|
|
15
|
-
export type _SpecificObjectiveVariable<VARIABLE_NAMES extends string = string> = {
|
|
16
|
-
type: "individual";
|
|
17
|
-
objective_type: OBJECTIVE_CRITERION;
|
|
18
|
-
/** The default value for the variable. 0 if undefined. */
|
|
19
|
-
default?: number;
|
|
20
|
-
/** The updater function is used to dynamically compute the value of the variable. */
|
|
21
|
-
updater?: (value: Score, variables: Record<VARIABLE_NAMES, Score>) => void;
|
|
22
|
-
};
|
|
23
|
-
export type _DummyGlobalVariable<VARIABLE_NAMES extends string = string> = {
|
|
24
|
-
type: "global";
|
|
25
|
-
/** Whether the value should be displayed in-game. */
|
|
26
|
-
hidden?: boolean;
|
|
27
|
-
/** The default value for the variable. 0 if undefined. */
|
|
28
|
-
default?: number;
|
|
29
|
-
/** The updater function is used to dynamically compute the value of the variable. */
|
|
30
|
-
updater?: (value: Score, variables: Record<VARIABLE_NAMES, Score>) => void;
|
|
31
|
-
};
|
|
32
|
-
export type _DummyIndividualVariable<VARIABLE_NAMES extends string = string> = {
|
|
33
|
-
type: "individual";
|
|
34
|
-
/** The default value for the variable. 0 if undefined. */
|
|
35
|
-
default?: number;
|
|
36
|
-
/** The updater function is used to dynamically compute the value of the variable. */
|
|
37
|
-
updater?: (value: Score, variables: Record<VARIABLE_NAMES, Score>) => void;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* A custom variable defined for the whole challenge.
|
|
41
|
-
*/
|
|
42
|
-
export type _InputVariableType<VARIABLE_NAMES extends string = string> = _SpecificObjectiveVariable<VARIABLE_NAMES> | _DummyGlobalVariable<VARIABLE_NAMES> | _DummyIndividualVariable<VARIABLE_NAMES>;
|
|
43
|
-
export declare function isSpecificObjectiveVariable(variable: _InputVariableType<string>): variable is _SpecificObjectiveVariable<string>;
|
|
44
|
-
/**
|
|
45
|
-
* The base configuration necessary to define events, end conditions, and win conditions for a challenge.
|
|
46
|
-
*/
|
|
47
|
-
export type _BaseConfig<ROLE_NAMES extends string, VARIABLE_NAMES extends string> = {
|
|
48
|
-
/**
|
|
49
|
-
* Name of the datapack that will be created for this challenge.
|
|
50
|
-
*/
|
|
51
|
-
name: string;
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated Ignored. The datapack output path is managed by the CLI, which
|
|
54
|
-
* injects `KRADLE_CHALLENGES_PATH`; the SDK resolves the location from it
|
|
55
|
-
* (falling back to `DEFAULT_CHALLENGE_PATH` for standalone use). Any value
|
|
56
|
-
* passed here is ignored and logs a warning at build time. Kept optional only
|
|
57
|
-
* for backward compatibility — remove it from your config.
|
|
58
|
-
*/
|
|
59
|
-
kradle_challenge_path?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Game duration in ticks.
|
|
62
|
-
*
|
|
63
|
-
* If not specified (or set to 0), the game will run indefinitely until
|
|
64
|
-
* an explicit end condition is met.
|
|
65
|
-
*
|
|
66
|
-
* @default undefined (no time limit)
|
|
67
|
-
*/
|
|
68
|
-
GAME_DURATION?: number;
|
|
69
|
-
roles: ROLE_NAMES[];
|
|
70
|
-
custom_variables: Record<VARIABLE_NAMES, _InputVariableType<VARIABLE_NAMES | BUILTIN_VARIABLE_NAMES>>;
|
|
71
|
-
/**
|
|
72
|
-
* The world spawn point for the challenge.
|
|
73
|
-
* Can be either explicit coordinates `{ x, y, z }` or an entity selector
|
|
74
|
-
* (e.g., from `Actions.getLocation({ name: "spawn" })`).
|
|
75
|
-
* When using an entity selector, `setworldspawn` will be executed at the entity's location.
|
|
76
|
-
*/
|
|
77
|
-
spawnPoint?: SpawnPoint;
|
|
78
|
-
/**
|
|
79
|
-
* Per-challenge overrides for the implicit setup the SDK applies inside
|
|
80
|
-
* `start_challenge` and `init_participants`. Defaults are sensible for
|
|
81
|
-
* most challenges, so this can usually be omitted entirely.
|
|
82
|
-
*
|
|
83
|
-
* Pass partial overrides to disable individual rules — e.g.
|
|
84
|
-
* `{ mobSpawning: true }` for a wave-defense challenge that needs
|
|
85
|
-
* natural mob spawns, or `{ clearInventory: false }` for a PvP
|
|
86
|
-
* challenge that pre-stocks inventory in `start_challenge`.
|
|
87
|
-
*
|
|
88
|
-
* Pass `false` to disable everything — the user is responsible for
|
|
89
|
-
* setting up time, gamerules, and per-player init themselves.
|
|
90
|
-
*
|
|
91
|
-
* @default { time: "day", daylightCycle: false, mobSpawning: false, naturalRegeneration: true, clearInventory: true, maxHealth: 20 }
|
|
92
|
-
*/
|
|
93
|
-
defaults?: ChallengeDefaults | false;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Knobs for the implicit setup the SDK runs at the top of `start_challenge`
|
|
97
|
-
* and `init_participants`. Each field is optional and falls back to the
|
|
98
|
-
* SDK-level default; pass `false` for a boolean field to disable that rule.
|
|
99
|
-
*/
|
|
100
|
-
export type ChallengeDefaults = {
|
|
101
|
-
/**
|
|
102
|
-
* Initial in-game time. `false` to leave time alone (server-default;
|
|
103
|
-
* clock continues based on world save).
|
|
104
|
-
* @default "day"
|
|
105
|
-
*/
|
|
106
|
-
time?: "day" | "noon" | "night" | "midnight" | false;
|
|
107
|
-
/**
|
|
108
|
-
* `gamerule doDaylightCycle`.
|
|
109
|
-
* @default false (sun stays at noon → consistent visibility for the run)
|
|
110
|
-
*/
|
|
111
|
-
daylightCycle?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* `gamerule doMobSpawning`. Override to `true` for wave-defense or
|
|
114
|
-
* boss-summon challenges that depend on natural spawns.
|
|
115
|
-
* @default false
|
|
116
|
-
*/
|
|
117
|
-
mobSpawning?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* `gamerule naturalRegeneration`. Override to `false` for tight
|
|
120
|
-
* combat-tuned challenges where healing-on-idle would mask agent skill.
|
|
121
|
-
* @default true
|
|
122
|
-
*/
|
|
123
|
-
naturalRegeneration?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Clear every participant's inventory at the top of `init_participants`.
|
|
126
|
-
* Override to `false` for PvP challenges that pre-stock inventory
|
|
127
|
-
* during `start_challenge`.
|
|
128
|
-
* @default true
|
|
129
|
-
*/
|
|
130
|
-
clearInventory?: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* `setAttribute generic.max_health` per participant. Pass `false` to
|
|
133
|
-
* leave health alone (vanilla 20 HP). Pass a number to set a non-default
|
|
134
|
-
* cap (e.g. 40 for a longer-form survival challenge).
|
|
135
|
-
* @default 20
|
|
136
|
-
*/
|
|
137
|
-
maxHealth?: number | false;
|
|
138
|
-
};
|
|
139
|
-
/** Resolved defaults — every field present, no `undefined` fallthroughs. */
|
|
140
|
-
export type ResolvedDefaults = {
|
|
141
|
-
time: "day" | "noon" | "night" | "midnight" | false;
|
|
142
|
-
daylightCycle: boolean;
|
|
143
|
-
mobSpawning: boolean;
|
|
144
|
-
naturalRegeneration: boolean;
|
|
145
|
-
clearInventory: boolean;
|
|
146
|
-
maxHealth: number | false;
|
|
147
|
-
};
|
|
148
|
-
export declare const DEFAULT_CHALLENGE_DEFAULTS: ResolvedDefaults;
|
|
149
|
-
/**
|
|
150
|
-
* Resolve a partial `ChallengeDefaults` (or `false` for "skip all setup")
|
|
151
|
-
* against the SDK-level defaults. Returns a fully-populated config the
|
|
152
|
-
* SDK can read without optional-chaining everywhere.
|
|
153
|
-
*/
|
|
154
|
-
export declare function resolveChallengeDefaults(input: ChallengeDefaults | false | undefined): ResolvedDefaults | null;
|
|
155
|
-
export type _ScenarioEvents = Partial<Record<POSSIBLE_SCENARIO_EVENTS, () => void>>;
|
|
156
|
-
export type Roles<ROLES_NAMES extends string = string> = {
|
|
157
|
-
[role in ROLES_NAMES]: role;
|
|
158
|
-
};
|
|
159
|
-
export type FullVariable<VARIABLE_NAMES extends string = string> = {
|
|
160
|
-
type: "individual" | "global";
|
|
161
|
-
score: Score;
|
|
162
|
-
default: number | undefined;
|
|
163
|
-
updater: ((value: Score, variables: Record<VARIABLE_NAMES, Score>) => void) | undefined;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* "Full" variables are the variables the challenges passes to the user in events/other variable updaters.
|
|
167
|
-
*/
|
|
168
|
-
export type FullVariables<VARIABLE_NAMES extends string = string> = Record<VARIABLE_NAMES | BUILTIN_VARIABLE_NAMES, FullVariable<VARIABLE_NAMES>>;
|
|
169
|
-
export type Variables<VARIABLE_NAMES extends string = string> = Record<VARIABLE_NAMES | BUILTIN_VARIABLE_NAMES, Score>;
|
|
170
|
-
type _InputEventCommonProperties = {
|
|
171
|
-
/** The target score to reach to trigger the event */
|
|
172
|
-
target?: number | undefined;
|
|
173
|
-
/** The mode of the event, either fire once or fire every time the score reaches the target */
|
|
174
|
-
mode: "fire_once" | "repeatable";
|
|
175
|
-
/** Actions to execute when the event is triggered */
|
|
176
|
-
actions: () => void;
|
|
177
|
-
};
|
|
178
|
-
export type _InputScoreCustomEventType = {
|
|
179
|
-
/** The target score to reach to trigger the event */
|
|
180
|
-
score: Score;
|
|
181
|
-
} & _InputEventCommonProperties;
|
|
182
|
-
export type _InputAdvancementCustomEventType = {
|
|
183
|
-
/** A list of criteria that must be met to trigger the event */
|
|
184
|
-
criteria: AdvancementTriggers[];
|
|
185
|
-
} & _InputEventCommonProperties;
|
|
186
|
-
export type _InputCustomEventType = _InputScoreCustomEventType | _InputAdvancementCustomEventType;
|
|
187
|
-
export type CustomScoreEvent = {
|
|
188
|
-
/** The input event that defines the conditions for the custom event */
|
|
189
|
-
inputEvent: _InputScoreCustomEventType;
|
|
190
|
-
/** The score that counts how many times the event has been triggered */
|
|
191
|
-
counter: Score;
|
|
192
|
-
/** The type of the event */
|
|
193
|
-
type: "global" | "individual";
|
|
194
|
-
/** A name used for debugging purposes */
|
|
195
|
-
debugName: string;
|
|
196
|
-
};
|
|
197
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAE7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEpF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAG1F,MAAM,MAAM,0BAA0B,CAAC,cAAc,SAAS,MAAM,GAAG,MAAM,IAAI;IAChF,IAAI,EAAE,YAAY,CAAC;IACnB,cAAc,EAAE,mBAAmB,CAAC;IACpC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;CAC3E,CAAC;AAKF,MAAM,MAAM,oBAAoB,CAAC,cAAc,SAAS,MAAM,GAAG,MAAM,IAAI;IAC1E,IAAI,E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C,wEAAwE;IACxE,OAAO,EAAE,KAAK,CAAC;IAEf,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAE9B,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/dist/types.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_CHALLENGE_DEFAULTS = exports.Actions = void 0;
|
|
4
|
-
exports.isSpecificObjectiveVariable = isSpecificObjectiveVariable;
|
|
5
|
-
exports.resolveChallengeDefaults = resolveChallengeDefaults;
|
|
6
|
-
var actions_1 = require("./actions");
|
|
7
|
-
Object.defineProperty(exports, "Actions", { enumerable: true, get: function () { return actions_1.Actions; } });
|
|
8
|
-
function isSpecificObjectiveVariable(variable) {
|
|
9
|
-
return variable.type === "individual" && !!variable.objective_type;
|
|
10
|
-
}
|
|
11
|
-
exports.DEFAULT_CHALLENGE_DEFAULTS = {
|
|
12
|
-
time: "day",
|
|
13
|
-
daylightCycle: false,
|
|
14
|
-
mobSpawning: false,
|
|
15
|
-
naturalRegeneration: true,
|
|
16
|
-
clearInventory: true,
|
|
17
|
-
maxHealth: 20,
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Resolve a partial `ChallengeDefaults` (or `false` for "skip all setup")
|
|
21
|
-
* against the SDK-level defaults. Returns a fully-populated config the
|
|
22
|
-
* SDK can read without optional-chaining everywhere.
|
|
23
|
-
*/
|
|
24
|
-
function resolveChallengeDefaults(input) {
|
|
25
|
-
if (input === false)
|
|
26
|
-
return null;
|
|
27
|
-
if (input === undefined)
|
|
28
|
-
return exports.DEFAULT_CHALLENGE_DEFAULTS;
|
|
29
|
-
return {
|
|
30
|
-
time: input.time === undefined ? exports.DEFAULT_CHALLENGE_DEFAULTS.time : input.time,
|
|
31
|
-
daylightCycle: input.daylightCycle ?? exports.DEFAULT_CHALLENGE_DEFAULTS.daylightCycle,
|
|
32
|
-
mobSpawning: input.mobSpawning ?? exports.DEFAULT_CHALLENGE_DEFAULTS.mobSpawning,
|
|
33
|
-
naturalRegeneration: input.naturalRegeneration ?? exports.DEFAULT_CHALLENGE_DEFAULTS.naturalRegeneration,
|
|
34
|
-
clearInventory: input.clearInventory ?? exports.DEFAULT_CHALLENGE_DEFAULTS.clearInventory,
|
|
35
|
-
maxHealth: input.maxHealth === undefined ? exports.DEFAULT_CHALLENGE_DEFAULTS.maxHealth : input.maxHealth,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAqDA,kEAIC;AAkID,4DAWC;AAhMD,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AA+ChB,SAAgB,2BAA2B,CAC1C,QAAoC;IAEpC,OAAO,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAE,QAAgB,CAAC,cAAc,CAAC;AAC7E,CAAC;AAoHY,QAAA,0BAA0B,GAAqB;IAC3D,IAAI,EAAE,KAAK;IACX,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,KAAK;IAClB,mBAAmB,EAAE,IAAI;IACzB,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,EAAE;CACb,CAAC;AAEF;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,KAA4C;IACpF,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,kCAA0B,CAAC;IAC3D,OAAO;QACN,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,kCAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI;QAC7E,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,kCAA0B,CAAC,aAAa;QAC9E,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,kCAA0B,CAAC,WAAW;QACxE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,IAAI,kCAA0B,CAAC,mBAAmB;QAChG,cAAc,EAAE,KAAK,CAAC,cAAc,IAAI,kCAA0B,CAAC,cAAc;QACjF,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,kCAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS;KACjG,CAAC;AACH,CAAC"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type LiteralStringUnion<LiteralType> = LiteralType | (string & Record<never, never>);
|
|
2
|
-
/**
|
|
3
|
-
* Generates a unique child function name based on the given name & the current context.
|
|
4
|
-
*
|
|
5
|
-
* For example, if you're inside a MCFunction named "test",
|
|
6
|
-
* getChildFunctionName("myFunction") will return "test/myFunction".
|
|
7
|
-
*
|
|
8
|
-
* This is useful to get meaningful names for child functions, instead of the standard "execute_as_1/2/3...".
|
|
9
|
-
*
|
|
10
|
-
* 👉 This brings more clarity to the generated functions tree, without impacting the datapack behavior.
|
|
11
|
-
*
|
|
12
|
-
* @param name The base name for the child function.
|
|
13
|
-
*
|
|
14
|
-
* @returns A meaningful child function name that is unique within the current context.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getChildFunctionName(name: string): string;
|
|
17
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,CAAC,WAAW,IAAI,WAAW,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAE5F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
package/dist/utils.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getChildFunctionName = getChildFunctionName;
|
|
4
|
-
const init_1 = require("sandstone/init");
|
|
5
|
-
/**
|
|
6
|
-
* Generates a unique child function name based on the given name & the current context.
|
|
7
|
-
*
|
|
8
|
-
* For example, if you're inside a MCFunction named "test",
|
|
9
|
-
* getChildFunctionName("myFunction") will return "test/myFunction".
|
|
10
|
-
*
|
|
11
|
-
* This is useful to get meaningful names for child functions, instead of the standard "execute_as_1/2/3...".
|
|
12
|
-
*
|
|
13
|
-
* 👉 This brings more clarity to the generated functions tree, without impacting the datapack behavior.
|
|
14
|
-
*
|
|
15
|
-
* @param name The base name for the child function.
|
|
16
|
-
*
|
|
17
|
-
* @returns A meaningful child function name that is unique within the current context.
|
|
18
|
-
*/
|
|
19
|
-
function getChildFunctionName(name) {
|
|
20
|
-
return init_1.dataPack.getUniqueChildName(name).fullName;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAmBA,oDAEC;AArBD,yCAA0C;AAK1C;;;;;;;;;;;;;GAaG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAChD,OAAO,eAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;AACnD,CAAC"}
|