@tuprolog/arg2p-ui 0.0.0-stage → 0.1.1

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.
Files changed (71) hide show
  1. package/README.md +75 -2
  2. package/dist/components/arg2p-editor.d.ts +73 -0
  3. package/dist/components/arg2p-editor.js +244 -0
  4. package/dist/components/arg2p-editor.js.map +1 -0
  5. package/dist/components/arg2p-flags.d.ts +58 -0
  6. package/dist/components/arg2p-flags.js +358 -0
  7. package/dist/components/arg2p-flags.js.map +1 -0
  8. package/dist/components/arg2p-framework.d.ts +102 -0
  9. package/dist/components/arg2p-framework.js +513 -0
  10. package/dist/components/arg2p-framework.js.map +1 -0
  11. package/dist/components/arg2p-graph.d.ts +112 -0
  12. package/dist/components/arg2p-graph.js +577 -0
  13. package/dist/components/arg2p-graph.js.map +1 -0
  14. package/dist/components/arg2p-solutions.d.ts +75 -0
  15. package/dist/components/arg2p-solutions.js +391 -0
  16. package/dist/components/arg2p-solutions.js.map +1 -0
  17. package/dist/data.d.ts +9 -0
  18. package/dist/data.js +11 -0
  19. package/dist/data.js.map +1 -0
  20. package/dist/editor/language.d.ts +9 -0
  21. package/dist/editor/language.js +78 -0
  22. package/dist/editor/language.js.map +1 -0
  23. package/dist/engine.d.ts +94 -0
  24. package/dist/engine.js +2 -0
  25. package/dist/engine.js.map +1 -0
  26. package/dist/flags/schema.d.ts +50 -0
  27. package/dist/flags/schema.js +195 -0
  28. package/dist/flags/schema.js.map +1 -0
  29. package/dist/flags/text.d.ts +18 -0
  30. package/dist/flags/text.js +85 -0
  31. package/dist/flags/text.js.map +1 -0
  32. package/dist/formats/declarations.d.ts +9 -0
  33. package/dist/formats/declarations.js +193 -0
  34. package/dist/formats/declarations.js.map +1 -0
  35. package/dist/formats/frameworks.d.ts +23 -0
  36. package/dist/formats/frameworks.js +130 -0
  37. package/dist/formats/frameworks.js.map +1 -0
  38. package/dist/graph/canvas.d.ts +21 -0
  39. package/dist/graph/canvas.js +76 -0
  40. package/dist/graph/canvas.js.map +1 -0
  41. package/dist/graph/drawing.d.ts +24 -0
  42. package/dist/graph/drawing.js +64 -0
  43. package/dist/graph/drawing.js.map +1 -0
  44. package/dist/graph/layout.d.ts +28 -0
  45. package/dist/graph/layout.js +167 -0
  46. package/dist/graph/layout.js.map +1 -0
  47. package/dist/graph/levels.d.ts +6 -0
  48. package/dist/graph/levels.js +25 -0
  49. package/dist/graph/levels.js.map +1 -0
  50. package/dist/graph/positions.d.ts +24 -0
  51. package/dist/graph/positions.js +43 -0
  52. package/dist/graph/positions.js.map +1 -0
  53. package/dist/index.d.ts +8 -0
  54. package/dist/index.js +11 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/js/engine.d.ts +35 -0
  57. package/dist/js/engine.js +110 -0
  58. package/dist/js/engine.js.map +1 -0
  59. package/dist/js/host.d.ts +75 -0
  60. package/dist/js/host.js +237 -0
  61. package/dist/js/host.js.map +1 -0
  62. package/dist/js/index.d.ts +2 -0
  63. package/dist/js/index.js +4 -0
  64. package/dist/js/index.js.map +1 -0
  65. package/dist/js/worker.d.ts +1 -0
  66. package/dist/js/worker.js +7 -0
  67. package/dist/js/worker.js.map +1 -0
  68. package/dist/theme.d.ts +5 -0
  69. package/dist/theme.js +48 -0
  70. package/dist/theme.js.map +1 -0
  71. package/package.json +65 -4
@@ -0,0 +1,94 @@
1
+ import type { Settings } from './flags/schema.js';
2
+ /** An argument of a graph, by its identifier (A0, A1, ...) */
3
+ export interface ArgumentData {
4
+ readonly id: string;
5
+ /** How it is written, `A2 : A0,r1 : c` */
6
+ readonly descriptor: string;
7
+ /** The statement it concludes, as arg2p writes it (`-a`) */
8
+ readonly conclusion: string;
9
+ /** Its top rule, `none` for a premise */
10
+ readonly topRule: string;
11
+ /** in, out, und, or na for an argument the labelling does not label */
12
+ readonly label: string;
13
+ /** The identifiers of the arguments it is built on */
14
+ readonly supports: readonly string[];
15
+ }
16
+ /** An attack, by the identifiers of its arguments: its type (rebut, undermine, undercut, ...) and the sub-argument hit */
17
+ export interface AttackData {
18
+ readonly from: string;
19
+ readonly to: string;
20
+ readonly type: string | null;
21
+ readonly on: string | null;
22
+ }
23
+ export interface GraphData {
24
+ /**
25
+ * The profile the theory was read in (aspic_plus, aba, abstract, ...: the value of graphBuildMode in effect), empty
26
+ * when unknown. In an abstract framework the arguments are named by the theory (their conclusion), with no structure.
27
+ */
28
+ readonly profile: string;
29
+ readonly arguments: readonly ArgumentData[];
30
+ readonly attacks: readonly AttackData[];
31
+ }
32
+ export declare const EMPTY_GRAPH: GraphData;
33
+ /** A solution of a query: yes, no or halt (an error), what it binds, and the graph it computed */
34
+ export interface SolutionData {
35
+ readonly result: 'yes' | 'no' | 'halt';
36
+ /** The query, its variables bound for a yes solution */
37
+ readonly query: string;
38
+ readonly bindings: readonly {
39
+ readonly name: string;
40
+ readonly value: string;
41
+ }[];
42
+ /** The error of a halt solution */
43
+ readonly error: string | null;
44
+ readonly graph: GraphData;
45
+ /** The context branch the graph is in: the stages 0 to branch can be read back (see Run.graphAt) */
46
+ readonly branch: number;
47
+ }
48
+ /** Where a text does not parse: its line and column (from 1), the length of the token, and why */
49
+ export interface SyntaxProblem {
50
+ readonly line: number;
51
+ readonly column: number;
52
+ readonly length: number;
53
+ readonly message: string;
54
+ }
55
+ /** An evaluation that failed: a theory, flags or a query that cannot be read, a theory its profile refuses, ... */
56
+ export interface EngineError {
57
+ readonly name: string;
58
+ readonly message: string;
59
+ /** Where the text does not parse, and which text it is */
60
+ readonly syntax: (SyntaxProblem & {
61
+ readonly where: 'theory' | 'flags' | 'query';
62
+ }) | null;
63
+ /** The evaluation was stopped (see Engine.stop) */
64
+ readonly stopped?: boolean;
65
+ }
66
+ /** The solutions of a query, computed one at a time as they are asked for */
67
+ export interface Run {
68
+ /** The query, as the engine read it */
69
+ readonly query: string;
70
+ hasNext(): boolean;
71
+ next(): Promise<SolutionData>;
72
+ /** The graph of the stage [branch] of the computation */
73
+ graphAt(branch: number): Promise<GraphData>;
74
+ }
75
+ export interface SolveRequest {
76
+ readonly theory: string;
77
+ readonly query: string;
78
+ /** The flags, as Prolog facts: the solver has these alone */
79
+ readonly flags: string;
80
+ }
81
+ export interface Engine {
82
+ /** The solutions of [request] (a rejected promise holds an EngineError); what the solver prints goes to [output] */
83
+ solve(request: SolveRequest, output?: (text: string) => void): Promise<Run>;
84
+ /** Where [text], a theory (or flags) or a query, does not parse; null if it does */
85
+ check(text: string, kind: 'theory' | 'query'): Promise<SyntaxProblem | null>;
86
+ /**
87
+ * The values of the flags in effect for [theory] solved with [flags]: those the theory states, or else those of
88
+ * the flags that differ from their default, or else those its profile presets (those of the flags alone when the
89
+ * theory does not parse)
90
+ */
91
+ settings(theory: string, flags: string): Promise<Settings>;
92
+ /** Stops the evaluation going on: what it was waited for fails, as stopped */
93
+ stop(): void;
94
+ }
package/dist/engine.js ADDED
@@ -0,0 +1,2 @@
1
+ export const EMPTY_GRAPH = { profile: '', arguments: [], attacks: [] };
2
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAsCA,MAAM,CAAC,MAAM,WAAW,GAAc,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC"}
@@ -0,0 +1,50 @@
1
+ /** A value a flag may take: what it is called, and what it does */
2
+ export interface FlagOption {
3
+ readonly value: string;
4
+ readonly label: string;
5
+ readonly help: string;
6
+ }
7
+ /**
8
+ * A flag: `choice` has one value, `set` several (the fact may appear several times), `switch` is on or off (the fact
9
+ * is there or not), `text` has a free value. A [required] flag needs a value for the solver to run.
10
+ */
11
+ export interface Flag {
12
+ readonly name: string;
13
+ readonly kind: 'choice' | 'set' | 'switch' | 'text';
14
+ readonly label: string;
15
+ readonly help: string;
16
+ readonly options?: readonly FlagOption[];
17
+ readonly required?: boolean;
18
+ readonly placeholder?: string;
19
+ }
20
+ export interface FlagGroup {
21
+ readonly id: 'semantics' | 'preferences' | 'evaluation' | 'framework';
22
+ readonly title: string;
23
+ readonly flags: readonly Flag[];
24
+ }
25
+ /** A profile: what it reads a theory as, and the groups of flags that mean something for it */
26
+ export interface ProfileInfo {
27
+ readonly name: string;
28
+ readonly label: string;
29
+ readonly help: string;
30
+ readonly groups: readonly FlagGroup['id'][];
31
+ }
32
+ /** The values of the flags in effect for a theory, by flag: a switch on has the value `true` */
33
+ export type Settings = Readonly<Record<string, readonly string[]>>;
34
+ export declare const SEMANTICS: readonly FlagOption[];
35
+ export declare const FLAG_GROUPS: readonly FlagGroup[];
36
+ export declare const FLAGS: readonly Flag[];
37
+ export declare const PROFILES: readonly ProfileInfo[];
38
+ export declare const DEFAULT_PROFILE = "aspic_plus";
39
+ /**
40
+ * The value of every flag when nothing states it (those of Flags.defaults(), a switch on as `true`): the flags of the
41
+ * solver override what the profile presets only with other values than these
42
+ */
43
+ export declare const DEFAULTS: Settings;
44
+ /**
45
+ * The flags a new theory starts with: its semantics, and query mode (a switch is off unless stated). The solver fills
46
+ * in the others with the values of the profile, or their defaults: stated, they would keep the profile from presetting
47
+ * them only where they differ from the defaults.
48
+ */
49
+ export declare const DEFAULT_FLAGS: string;
50
+ export declare function profileInfo(name: string): ProfileInfo | undefined;
@@ -0,0 +1,195 @@
1
+ // The flags of arg2p (see the Flags page of its documentation) and its profiles, the values of graphBuildMode that
2
+ // preset them (see the Profiles page). The values are those of the enumerations of the API (Semantics, GraphExtension,
3
+ // ...): the tests of the host check them against it.
4
+ const option = (value, label, help) => ({ value, label, help });
5
+ export const SEMANTICS = [
6
+ option('grounded', 'Grounded', 'The least complete labelling: what is beyond doubt.'),
7
+ option('complete', 'Complete', "Dung's complete labellings."),
8
+ option('conflictfree', 'Conflict-free', 'Labellings with no attack between in arguments.'),
9
+ option('admissible', 'Admissible', 'Conflict-free labellings that defend their in arguments.'),
10
+ option('stronglyadmissible', 'Strongly admissible', 'Admissible labellings built up from unattacked arguments.'),
11
+ option('preferred', 'Preferred', 'The maximal admissible labellings.'),
12
+ option('semistable', 'Semi-stable', 'Complete labellings with the fewest und arguments.'),
13
+ option('stable', 'Stable', 'Labellings with no und argument.'),
14
+ option('ideal', 'Ideal', 'The largest admissible labelling within every preferred one.'),
15
+ option('eager', 'Eager', 'The largest admissible labelling within every semi-stable one.'),
16
+ option('naive', 'Naive', 'The maximal conflict-free labellings.'),
17
+ option('stage', 'Stage', 'Conflict-free labellings with the fewest und arguments.'),
18
+ option('cf2', 'CF2', 'Naive labellings of the strongly connected parts, in turn.'),
19
+ option('stage2', 'Stage2', 'Stage labellings of the strongly connected parts, in turn.'),
20
+ option('bp_grounded', 'Burden of persuasion (grounded)', 'The grounded labelling with burdens of persuasion.'),
21
+ option('bp_grounded_partial', 'Burden of persuasion (partial)', 'The partial labelling with burdens of persuasion.'),
22
+ option('bp_grounded_complete', 'Burden of persuasion (complete)', 'The complete labelling with burdens of persuasion.'),
23
+ ];
24
+ export const FLAG_GROUPS = [
25
+ {
26
+ id: 'semantics',
27
+ title: 'Semantics',
28
+ flags: [
29
+ {
30
+ name: 'argumentLabellingMode',
31
+ kind: 'choice',
32
+ required: true,
33
+ label: 'Argument semantics',
34
+ options: SEMANTICS,
35
+ help: 'Labels the arguments in, out or und. Semantics with several labellings give one solution each: use Next.',
36
+ },
37
+ {
38
+ name: 'statementLabellingMode',
39
+ kind: 'choice',
40
+ required: true,
41
+ label: 'Statement semantics',
42
+ options: [
43
+ option('statement', 'Standard', 'In if some in argument concludes it, otherwise out if some out argument does, otherwise und.'),
44
+ option('statement_pass_through', 'Pass-through', 'Passes the labels of the arguments on as they are.'),
45
+ option('statement_binary', 'Binary', 'In if some in argument concludes it, out otherwise.'),
46
+ ],
47
+ help: 'How the labels of the arguments pass to the statements they conclude.',
48
+ },
49
+ ],
50
+ },
51
+ {
52
+ id: 'preferences',
53
+ title: 'Preferences',
54
+ flags: [
55
+ {
56
+ name: 'graphExtension',
57
+ kind: 'set',
58
+ label: 'Graph extensions',
59
+ options: [
60
+ option('standardPref', 'Static preferences', 'Attacks that do not succeed as defeats are removed by the ordering of the arguments.'),
61
+ option('defeasiblePref', 'Defeasible preferences', 'A sup/2 concluded by a rule counts as a preference (single superiorities).'),
62
+ option('defeasibleAllPref', 'All defeasible preferences', 'Comparisons that need several superiorities at once, too.'),
63
+ option('rebutRestriction', 'Restricted rebut', 'An argument cannot rebut a conclusion drawn by a strict rule.'),
64
+ option('abaPref', 'ABA+ preferences', 'An attack from an assumption weaker than the one it attacks is reversed (sup/2).'),
65
+ option('bp', 'Arguable burden of persuasion', 'The burden is concluded by a rule, as r : [] => bp(x).'),
66
+ ],
67
+ help: 'Applied to the graph once it is built. None ticked: no preference.',
68
+ },
69
+ {
70
+ name: 'orderingPrinciple',
71
+ kind: 'choice',
72
+ required: true,
73
+ label: 'Ordering principle',
74
+ options: [
75
+ option('last', 'Last link', 'Compares the last defeasible rules of the arguments.'),
76
+ option('weakest', 'Weakest link', 'Compares all their defeasible rules: an argument is as strong as its weakest.'),
77
+ ],
78
+ help: 'Which rules of two arguments are compared.',
79
+ },
80
+ {
81
+ name: 'orderingComparator',
82
+ kind: 'choice',
83
+ required: true,
84
+ label: 'Ordering comparator',
85
+ options: [
86
+ option('elitist', 'Elitist', 'Weaker if some of its rules is weaker than all the rules of the other.'),
87
+ option('democrat', 'Democrat', 'Weaker if each of its rules is weaker than some rule of the other.'),
88
+ option('normal', 'Normal', 'The attack relation of Dung and Thang, on the last rules (with the last link alone).'),
89
+ ],
90
+ help: 'How the rules picked by the principle are compared.',
91
+ },
92
+ ],
93
+ },
94
+ {
95
+ id: 'evaluation',
96
+ title: 'Evaluation',
97
+ flags: [
98
+ { name: 'queryMode', kind: 'switch', label: 'Query mode', help: 'Builds only the part of the graph the query needs: much faster on large theories.' },
99
+ { name: 'autoTransposition', kind: 'switch', label: 'Transposition', help: 'Closes the strict rules under transposition, as the rationality postulates need.' },
100
+ { name: 'prologStrictCompatibility', kind: 'switch', label: 'Prolog clauses argued', help: 'The Prolog clauses of the theory are argued too.' },
101
+ { name: 'metaConflicts', kind: 'switch', label: 'Meta conflicts', help: 'Conflicts are arguments as well, which may be attacked.' },
102
+ { name: 'metaRules', kind: 'switch', label: 'Meta rules', help: 'Rules are arguments as well, which may be attacked.' },
103
+ { name: 'debug', kind: 'switch', label: 'Debug', help: 'The partial burden of persuasion writes the steps of its labelling.' },
104
+ {
105
+ name: 'modulesPath',
106
+ kind: 'text',
107
+ label: 'Modules path',
108
+ placeholder: 'https://example.org/theories',
109
+ help: 'Where call_module/2 loads modules from, a directory or a base URL. Empty: none.',
110
+ },
111
+ ],
112
+ },
113
+ {
114
+ id: 'framework',
115
+ title: 'Framework',
116
+ flags: [
117
+ {
118
+ name: 'graphBuilder',
119
+ kind: 'choice',
120
+ label: 'Graph builder',
121
+ options: [
122
+ option('ruleGraph', 'Rules', 'The arguments built from the rules of the theory.'),
123
+ option('abstractGraph', 'Arguments and attacks', 'The arguments and attacks the theory states.'),
124
+ ],
125
+ help: 'How the graph is built. The profile sets it.',
126
+ },
127
+ {
128
+ name: 'graphLanguage',
129
+ kind: 'set',
130
+ label: 'Languages',
131
+ options: [
132
+ option('aspicLanguage', 'ASPIC+', 'Contraries well formed.'),
133
+ option('abaLanguage', 'ABA', 'Assumptions and contraries, flat, strict rules alone.'),
134
+ option('defeasibleLanguage', 'Defeasible', 'Defeasible rules alone.'),
135
+ ],
136
+ help: 'What the theory is read and checked as, beyond the language of arg2p. The profile sets them.',
137
+ },
138
+ {
139
+ name: 'conflictModel',
140
+ kind: 'choice',
141
+ label: 'Conflicts',
142
+ options: [
143
+ option('builtin', 'Built in', 'A literal and its negation, obligations and permissions, and the conflicts declared.'),
144
+ option('declared', 'Declared', 'The conflicts the theory declares alone, as the contraries of ABA.'),
145
+ ],
146
+ help: 'The conflicts beyond those the theory declares.',
147
+ },
148
+ ],
149
+ },
150
+ ];
151
+ export const FLAGS = FLAG_GROUPS.flatMap(group => group.flags);
152
+ const ALL_GROUPS = ['semantics', 'preferences', 'evaluation', 'framework'];
153
+ export const PROFILES = [
154
+ { name: 'aspic_plus', label: 'ASPIC+', help: 'Strict and defeasible rules, axioms and premises, preferences, restricted rebut, transposition.', groups: ALL_GROUPS },
155
+ { name: 'aspic', label: 'ASPIC+ without preferences', help: 'ASPIC+ where every attack succeeds.', groups: ALL_GROUPS },
156
+ { name: 'aspic_defeasible', label: 'ASPIC+, defeasible rules', help: 'Defeasible rules alone (facts as r : [] => a.), preferences by the last link.', groups: ALL_GROUPS },
157
+ { name: 'meta', label: 'ASPIC+ with meta-argumentation', help: 'ASPIC+ reasoning about its own rules, conflicts and preferences.', groups: ALL_GROUPS },
158
+ { name: 'aba', label: 'ABA', help: 'Flat assumption-based argumentation: strict rules, assumption/1, contrary/2.', groups: ['semantics', 'evaluation', 'framework'] },
159
+ { name: 'aba_plus', label: 'ABA+', help: 'Flat ABA with preferences between assumptions (sup/2), attacks from weaker ones reversed.', groups: ALL_GROUPS },
160
+ { name: 'abstract', label: 'Abstract framework', help: 'Dung frameworks: arguments (a.), attacks (a -> b.) and mutual attacks (a <-> b.).', groups: ['semantics'] },
161
+ { name: 'free', label: 'Free', help: 'No preset: every flag as the flags and the theory state it.', groups: ALL_GROUPS },
162
+ ];
163
+ export const DEFAULT_PROFILE = 'aspic_plus';
164
+ /**
165
+ * The value of every flag when nothing states it (those of Flags.defaults(), a switch on as `true`): the flags of the
166
+ * solver override what the profile presets only with other values than these
167
+ */
168
+ export const DEFAULTS = {
169
+ graphBuildMode: [DEFAULT_PROFILE],
170
+ argumentLabellingMode: ['grounded'],
171
+ statementLabellingMode: ['statement'],
172
+ graphExtension: ['standardPref'],
173
+ orderingPrinciple: ['last'],
174
+ orderingComparator: ['elitist'],
175
+ queryMode: ['true'],
176
+ autoTransposition: [],
177
+ prologStrictCompatibility: [],
178
+ metaConflicts: [],
179
+ metaRules: [],
180
+ debug: [],
181
+ modulesPath: [],
182
+ graphBuilder: ['ruleGraph'],
183
+ graphLanguage: [],
184
+ conflictModel: ['builtin'],
185
+ };
186
+ /**
187
+ * The flags a new theory starts with: its semantics, and query mode (a switch is off unless stated). The solver fills
188
+ * in the others with the values of the profile, or their defaults: stated, they would keep the profile from presetting
189
+ * them only where they differ from the defaults.
190
+ */
191
+ export const DEFAULT_FLAGS = ['argumentLabellingMode(grounded).', 'statementLabellingMode(statement).', 'queryMode.', ''].join('\n');
192
+ export function profileInfo(name) {
193
+ return PROFILES.find(it => it.name === name);
194
+ }
195
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/flags/schema.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,uHAAuH;AACvH,qDAAqD;AAwCrD,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,IAAY,EAAc,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAEpG,MAAM,CAAC,MAAM,SAAS,GAA0B;IAC5C,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,qDAAqD,CAAC;IACrF,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,6BAA6B,CAAC;IAC7D,MAAM,CAAC,cAAc,EAAE,eAAe,EAAE,iDAAiD,CAAC;IAC1F,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,0DAA0D,CAAC;IAC9F,MAAM,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,2DAA2D,CAAC;IAChH,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,oCAAoC,CAAC;IACtE,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,oDAAoD,CAAC;IACzF,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,kCAAkC,CAAC;IAC9D,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,8DAA8D,CAAC;IACxF,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,gEAAgE,CAAC;IAC1F,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,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type Flag } from './schema.js';
2
+ /** What a text states for a flag: its values (for a switch, `true` if it is there), or nothing when it does not state it */
3
+ export type Stated = ReadonlyMap<string, readonly string[]>;
4
+ /**
5
+ * The flags [text] states, of [flags]: a switch stated on has the value `true` (`name.`), off none (`name(off).`); a
6
+ * flag stated with no value (`name(none).`) has none
7
+ */
8
+ export declare function statedFlags(text: string, flags?: readonly Flag[]): Stated;
9
+ /** The profile [text] states (graphBuildMode), if any */
10
+ export declare function statedProfile(text: string): string | null;
11
+ /** [text] stating [values] for the flag [name] (a choice or a text has one, or none: empty), one line each */
12
+ export declare function withValues(text: string, name: string, values: readonly string[]): string;
13
+ /** [text] stating a set with no value (`name(none).`): it clears what a profile presets */
14
+ export declare function withNone(text: string, name: string): string;
15
+ /** [text] stating the switch [name] on (`name.`) or off (`name(off).`) */
16
+ export declare function withSwitch(text: string, name: string, on: boolean): string;
17
+ /** [text] stating nothing for the flag [name]: it takes the value of the profile, or its default */
18
+ export declare function without(text: string, name: string): string;
@@ -0,0 +1,85 @@
1
+ import { FLAGS } from './schema.js';
2
+ const ATOM = /^[a-z][a-zA-Z0-9_]*$/;
3
+ function escape(name) {
4
+ return name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
5
+ }
6
+ // A line stating the flag with a value, `name(value).`, and an optional comment after it
7
+ function valueLine(name) {
8
+ return new RegExp(`^\\s*${escape(name)}\\s*\\(\\s*(.*?)\\s*\\)\\s*\\.\\s*(%.*)?$`);
9
+ }
10
+ function switchLine(name) {
11
+ return new RegExp(`^\\s*${escape(name)}\\s*\\.\\s*(%.*)?$`);
12
+ }
13
+ function unquote(value) {
14
+ const quoted = /^'(.*)'$/.exec(value);
15
+ return quoted ? quoted[1].replace(/''/g, "'") : value;
16
+ }
17
+ function quote(value) {
18
+ return ATOM.test(value) ? value : `'${value.replace(/'/g, "''")}'`;
19
+ }
20
+ function valuesOf(text, name) {
21
+ const pattern = valueLine(name);
22
+ return text
23
+ .split('\n')
24
+ .map(line => pattern.exec(line))
25
+ .filter((match) => match !== null)
26
+ .map(match => unquote(match[1]));
27
+ }
28
+ /**
29
+ * The flags [text] states, of [flags]: a switch stated on has the value `true` (`name.`), off none (`name(off).`); a
30
+ * flag stated with no value (`name(none).`) has none
31
+ */
32
+ export function statedFlags(text, flags = FLAGS) {
33
+ const stated = new Map();
34
+ flags.forEach(flag => {
35
+ const values = valuesOf(text, flag.name);
36
+ if (flag.kind === 'switch') {
37
+ if (text.split('\n').some(line => switchLine(flag.name).test(line)))
38
+ stated.set(flag.name, ['true']);
39
+ else if (values.length > 0)
40
+ stated.set(flag.name, values.includes('off') ? [] : ['true']);
41
+ }
42
+ else if (values.length > 0) {
43
+ stated.set(flag.name, values.filter(it => it !== 'none'));
44
+ }
45
+ });
46
+ return stated;
47
+ }
48
+ /** The profile [text] states (graphBuildMode), if any */
49
+ export function statedProfile(text) {
50
+ return valuesOf(text, 'graphBuildMode')[0] ?? null;
51
+ }
52
+ // Every line matching [pattern] replaced by [replacement] (some lines, or none), where the first of them was, or at
53
+ // the end when there was none
54
+ function replaceLines(text, patterns, replacement) {
55
+ const matches = (line) => patterns.some(it => it.test(line));
56
+ const lines = text.split('\n');
57
+ const first = lines.findIndex(matches);
58
+ const kept = lines.filter(line => !matches(line));
59
+ if (first === -1) {
60
+ if (replacement.length === 0)
61
+ return text;
62
+ const body = text.replace(/\s*$/, '');
63
+ return `${body === '' ? '' : `${body}\n`}${replacement.join('\n')}\n`;
64
+ }
65
+ kept.splice(first, 0, ...replacement);
66
+ return kept.join('\n');
67
+ }
68
+ /** [text] stating [values] for the flag [name] (a choice or a text has one, or none: empty), one line each */
69
+ export function withValues(text, name, values) {
70
+ const present = values.map(it => it.trim()).filter(it => it !== '');
71
+ return replaceLines(text, [valueLine(name)], present.map(it => `${name}(${quote(it)}).`));
72
+ }
73
+ /** [text] stating a set with no value (`name(none).`): it clears what a profile presets */
74
+ export function withNone(text, name) {
75
+ return replaceLines(text, [valueLine(name)], [`${name}(none).`]);
76
+ }
77
+ /** [text] stating the switch [name] on (`name.`) or off (`name(off).`) */
78
+ export function withSwitch(text, name, on) {
79
+ return replaceLines(text, [switchLine(name), valueLine(name)], [on ? `${name}.` : `${name}(off).`]);
80
+ }
81
+ /** [text] stating nothing for the flag [name]: it takes the value of the profile, or its default */
82
+ export function without(text, name) {
83
+ return replaceLines(text, [switchLine(name), valueLine(name)], []);
84
+ }
85
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/flags/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,aAAa,CAAC;AAQ/C,MAAM,IAAI,GAAG,sBAAsB,CAAC;AAEpC,SAAS,MAAM,CAAC,IAAY;IACxB,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,yFAAyF;AACzF,SAAS,SAAS,CAAC,IAAY;IAC3B,OAAO,IAAI,MAAM,CAAC,QAAQ,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,IAAI,MAAM,CAAC,QAAQ,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC1B,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1D,CAAC;AAED,SAAS,KAAK,CAAC,KAAa;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,KAA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AU,OAAO,CAAC,IAAY,EAAE,IAAY;IAC9C,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Framework } from './frameworks.js';
2
+ /** The framework [theory] declares: its arguments in the order they are met, with those its attacks name */
3
+ export declare function declaredFramework(theory: string): Framework;
4
+ /**
5
+ * [theory] declaring [framework] instead of what it declares: the declarations no longer drawn removed (half a mutual
6
+ * attack left as a plain one), the new ones added after the last declaration, one per line. [renamed] are arguments
7
+ * renamed in the drawing, renamed where they are declared.
8
+ */
9
+ export declare function redrawn(theory: string, framework: Framework, renamed?: ReadonlyMap<string, string>): string;