agentlang 0.10.1 → 0.10.3
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/README.md +7 -14
- package/out/api/http.d.ts +4 -0
- package/out/api/http.d.ts.map +1 -1
- package/out/api/http.js +307 -26
- package/out/api/http.js.map +1 -1
- package/out/cli/main.d.ts.map +1 -1
- package/out/cli/main.js +3 -0
- package/out/cli/main.js.map +1 -1
- package/out/extension/main.cjs +250 -250
- package/out/extension/main.cjs.map +2 -2
- package/out/language/agentlang-validator.d.ts.map +1 -1
- package/out/language/agentlang-validator.js +4 -0
- package/out/language/agentlang-validator.js.map +1 -1
- package/out/language/error-reporter.d.ts +53 -0
- package/out/language/error-reporter.d.ts.map +1 -0
- package/out/language/error-reporter.js +879 -0
- package/out/language/error-reporter.js.map +1 -0
- package/out/language/generated/ast.d.ts +77 -2
- package/out/language/generated/ast.d.ts.map +1 -1
- package/out/language/generated/ast.js +60 -0
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/generated/grammar.d.ts.map +1 -1
- package/out/language/generated/grammar.js +342 -206
- package/out/language/generated/grammar.js.map +1 -1
- package/out/language/main.cjs +901 -710
- package/out/language/main.cjs.map +3 -3
- package/out/language/parser.d.ts +4 -2
- package/out/language/parser.d.ts.map +1 -1
- package/out/language/parser.js +58 -99
- package/out/language/parser.js.map +1 -1
- package/out/language/syntax.d.ts +16 -0
- package/out/language/syntax.d.ts.map +1 -1
- package/out/language/syntax.js +66 -27
- package/out/language/syntax.js.map +1 -1
- package/out/runtime/api.d.ts +2 -0
- package/out/runtime/api.d.ts.map +1 -1
- package/out/runtime/api.js +25 -0
- package/out/runtime/api.js.map +1 -1
- package/out/runtime/datefns.d.ts +34 -0
- package/out/runtime/datefns.d.ts.map +1 -0
- package/out/runtime/datefns.js +82 -0
- package/out/runtime/datefns.js.map +1 -0
- package/out/runtime/defs.d.ts +1 -0
- package/out/runtime/defs.d.ts.map +1 -1
- package/out/runtime/defs.js +2 -1
- package/out/runtime/defs.js.map +1 -1
- package/out/runtime/document-retriever.d.ts +24 -0
- package/out/runtime/document-retriever.d.ts.map +1 -0
- package/out/runtime/document-retriever.js +258 -0
- package/out/runtime/document-retriever.js.map +1 -0
- package/out/runtime/embeddings/chunker.d.ts +18 -0
- package/out/runtime/embeddings/chunker.d.ts.map +1 -1
- package/out/runtime/embeddings/chunker.js +47 -15
- package/out/runtime/embeddings/chunker.js.map +1 -1
- package/out/runtime/embeddings/openai.d.ts.map +1 -1
- package/out/runtime/embeddings/openai.js +22 -9
- package/out/runtime/embeddings/openai.js.map +1 -1
- package/out/runtime/embeddings/provider.d.ts +1 -0
- package/out/runtime/embeddings/provider.d.ts.map +1 -1
- package/out/runtime/embeddings/provider.js +20 -1
- package/out/runtime/embeddings/provider.js.map +1 -1
- package/out/runtime/exec-graph.d.ts.map +1 -1
- package/out/runtime/exec-graph.js +22 -3
- package/out/runtime/exec-graph.js.map +1 -1
- package/out/runtime/integration-client.d.ts +21 -0
- package/out/runtime/integration-client.d.ts.map +1 -0
- package/out/runtime/integration-client.js +112 -0
- package/out/runtime/integration-client.js.map +1 -0
- package/out/runtime/integrations.d.ts.map +1 -1
- package/out/runtime/integrations.js +20 -9
- package/out/runtime/integrations.js.map +1 -1
- package/out/runtime/interpreter.d.ts +10 -0
- package/out/runtime/interpreter.d.ts.map +1 -1
- package/out/runtime/interpreter.js +221 -22
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/loader.d.ts.map +1 -1
- package/out/runtime/loader.js +70 -7
- package/out/runtime/loader.js.map +1 -1
- package/out/runtime/logger.d.ts.map +1 -1
- package/out/runtime/logger.js +8 -1
- package/out/runtime/logger.js.map +1 -1
- package/out/runtime/module.d.ts +18 -0
- package/out/runtime/module.d.ts.map +1 -1
- package/out/runtime/module.js +91 -3
- package/out/runtime/module.js.map +1 -1
- package/out/runtime/modules/ai.d.ts +16 -5
- package/out/runtime/modules/ai.d.ts.map +1 -1
- package/out/runtime/modules/ai.js +286 -88
- package/out/runtime/modules/ai.js.map +1 -1
- package/out/runtime/modules/core.d.ts.map +1 -1
- package/out/runtime/modules/core.js +5 -1
- package/out/runtime/modules/core.js.map +1 -1
- package/out/runtime/monitor.d.ts +6 -0
- package/out/runtime/monitor.d.ts.map +1 -1
- package/out/runtime/monitor.js +21 -1
- package/out/runtime/monitor.js.map +1 -1
- package/out/runtime/relgraph.d.ts.map +1 -1
- package/out/runtime/relgraph.js +7 -3
- package/out/runtime/relgraph.js.map +1 -1
- package/out/runtime/resolvers/interface.d.ts +7 -2
- package/out/runtime/resolvers/interface.d.ts.map +1 -1
- package/out/runtime/resolvers/interface.js +17 -3
- package/out/runtime/resolvers/interface.js.map +1 -1
- package/out/runtime/resolvers/sqldb/database.d.ts +2 -0
- package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/database.js +142 -126
- package/out/runtime/resolvers/sqldb/database.js.map +1 -1
- package/out/runtime/resolvers/sqldb/dbutil.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/dbutil.js +25 -4
- package/out/runtime/resolvers/sqldb/dbutil.js.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.d.ts +2 -1
- package/out/runtime/resolvers/sqldb/impl.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.js +24 -7
- package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
- package/out/runtime/resolvers/vector/lancedb-store.d.ts +16 -0
- package/out/runtime/resolvers/vector/lancedb-store.d.ts.map +1 -0
- package/out/runtime/resolvers/vector/lancedb-store.js +159 -0
- package/out/runtime/resolvers/vector/lancedb-store.js.map +1 -0
- package/out/runtime/resolvers/vector/types.d.ts +32 -0
- package/out/runtime/resolvers/vector/types.d.ts.map +1 -0
- package/out/runtime/resolvers/vector/types.js +2 -0
- package/out/runtime/resolvers/vector/types.js.map +1 -0
- package/out/runtime/services/documentFetcher.d.ts.map +1 -1
- package/out/runtime/services/documentFetcher.js +21 -6
- package/out/runtime/services/documentFetcher.js.map +1 -1
- package/out/runtime/state.d.ts +19 -1
- package/out/runtime/state.d.ts.map +1 -1
- package/out/runtime/state.js +36 -1
- package/out/runtime/state.js.map +1 -1
- package/out/runtime/util.d.ts +3 -2
- package/out/runtime/util.d.ts.map +1 -1
- package/out/runtime/util.js +13 -2
- package/out/runtime/util.js.map +1 -1
- package/out/syntaxes/agentlang.monarch.js +1 -1
- package/out/syntaxes/agentlang.monarch.js.map +1 -1
- package/out/test-harness.d.ts +36 -0
- package/out/test-harness.d.ts.map +1 -0
- package/out/test-harness.js +341 -0
- package/out/test-harness.js.map +1 -0
- package/package.json +22 -19
- package/src/api/http.ts +336 -38
- package/src/cli/main.ts +3 -0
- package/src/language/agentlang-validator.ts +3 -0
- package/src/language/agentlang.langium +6 -2
- package/src/language/error-reporter.ts +1028 -0
- package/src/language/generated/ast.ts +94 -1
- package/src/language/generated/grammar.ts +342 -206
- package/src/language/parser.ts +64 -101
- package/src/language/syntax.ts +79 -24
- package/src/runtime/api.ts +36 -0
- package/src/runtime/datefns.ts +112 -0
- package/src/runtime/defs.ts +2 -1
- package/src/runtime/document-retriever.ts +311 -0
- package/src/runtime/embeddings/chunker.ts +52 -14
- package/src/runtime/embeddings/openai.ts +27 -9
- package/src/runtime/embeddings/provider.ts +22 -1
- package/src/runtime/exec-graph.ts +23 -2
- package/src/runtime/integration-client.ts +158 -0
- package/src/runtime/integrations.ts +20 -11
- package/src/runtime/interpreter.ts +221 -15
- package/src/runtime/loader.ts +83 -5
- package/src/runtime/logger.ts +12 -1
- package/src/runtime/module.ts +104 -3
- package/src/runtime/modules/ai.ts +341 -107
- package/src/runtime/modules/core.ts +5 -1
- package/src/runtime/monitor.ts +27 -1
- package/src/runtime/relgraph.ts +7 -3
- package/src/runtime/resolvers/interface.ts +23 -3
- package/src/runtime/resolvers/sqldb/database.ts +158 -130
- package/src/runtime/resolvers/sqldb/dbutil.ts +28 -6
- package/src/runtime/resolvers/sqldb/impl.ts +25 -7
- package/src/runtime/resolvers/vector/lancedb-store.ts +187 -0
- package/src/runtime/resolvers/vector/types.ts +39 -0
- package/src/runtime/services/documentFetcher.ts +21 -6
- package/src/runtime/state.ts +40 -1
- package/src/runtime/util.ts +19 -2
- package/src/syntaxes/agentlang.monarch.ts +1 -1
- package/src/test-harness.ts +423 -0
|
@@ -49,6 +49,7 @@ export type AgentlangKeywordNames =
|
|
|
49
49
|
| "@catch"
|
|
50
50
|
| "@desc"
|
|
51
51
|
| "@distinct"
|
|
52
|
+
| "@empty"
|
|
52
53
|
| "@enum"
|
|
53
54
|
| "@expr"
|
|
54
55
|
| "@from"
|
|
@@ -58,7 +59,9 @@ export type AgentlangKeywordNames =
|
|
|
58
59
|
| "@into"
|
|
59
60
|
| "@join"
|
|
60
61
|
| "@left_join"
|
|
62
|
+
| "@limit"
|
|
61
63
|
| "@meta"
|
|
64
|
+
| "@offset"
|
|
62
65
|
| "@oneof"
|
|
63
66
|
| "@orderBy"
|
|
64
67
|
| "@public"
|
|
@@ -586,6 +589,21 @@ export function isElse(item: unknown): item is Else {
|
|
|
586
589
|
return reflection.isInstance(item, Else.$type);
|
|
587
590
|
}
|
|
588
591
|
|
|
592
|
+
export interface EmptySpec extends langium.AstNode {
|
|
593
|
+
readonly $container: RuntimeHint;
|
|
594
|
+
readonly $type: 'EmptySpec';
|
|
595
|
+
stmt: Statement;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export const EmptySpec = {
|
|
599
|
+
$type: 'EmptySpec',
|
|
600
|
+
stmt: 'stmt'
|
|
601
|
+
} as const;
|
|
602
|
+
|
|
603
|
+
export function isEmptySpec(item: unknown): item is EmptySpec {
|
|
604
|
+
return reflection.isInstance(item, EmptySpec.$type);
|
|
605
|
+
}
|
|
606
|
+
|
|
589
607
|
export interface EntityActionsDefinitions extends langium.AstNode {
|
|
590
608
|
readonly $container: RecordExtraDefinition;
|
|
591
609
|
readonly $type: 'EntityActionsDefinitions';
|
|
@@ -1013,6 +1031,21 @@ export function isKvPairs(item: unknown): item is KvPairs {
|
|
|
1013
1031
|
return reflection.isInstance(item, KvPairs.$type);
|
|
1014
1032
|
}
|
|
1015
1033
|
|
|
1034
|
+
export interface LimitClause extends langium.AstNode {
|
|
1035
|
+
readonly $container: QueryOption;
|
|
1036
|
+
readonly $type: 'LimitClause';
|
|
1037
|
+
value: number;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export const LimitClause = {
|
|
1041
|
+
$type: 'LimitClause',
|
|
1042
|
+
value: 'value'
|
|
1043
|
+
} as const;
|
|
1044
|
+
|
|
1045
|
+
export function isLimitClause(item: unknown): item is LimitClause {
|
|
1046
|
+
return reflection.isInstance(item, LimitClause.$type);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1016
1049
|
export interface Literal extends langium.AstNode {
|
|
1017
1050
|
readonly $container: AttributeDefinition | BinExpr | CaseEntry | CrudMap | FnCall | FullTextSearch | GenericPropertyDef | Group | If | KvPair | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute | ThrowError | WhereSpecClause;
|
|
1018
1051
|
readonly $type: 'Literal';
|
|
@@ -1175,6 +1208,21 @@ export function isNotExpr(item: unknown): item is NotExpr {
|
|
|
1175
1208
|
return reflection.isInstance(item, NotExpr.$type);
|
|
1176
1209
|
}
|
|
1177
1210
|
|
|
1211
|
+
export interface OffsetClause extends langium.AstNode {
|
|
1212
|
+
readonly $container: QueryOption;
|
|
1213
|
+
readonly $type: 'OffsetClause';
|
|
1214
|
+
value: number;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export const OffsetClause = {
|
|
1218
|
+
$type: 'OffsetClause',
|
|
1219
|
+
value: 'value'
|
|
1220
|
+
} as const;
|
|
1221
|
+
|
|
1222
|
+
export function isOffsetClause(item: unknown): item is OffsetClause {
|
|
1223
|
+
return reflection.isInstance(item, OffsetClause.$type);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1178
1226
|
export interface OneOfSpec extends langium.AstNode {
|
|
1179
1227
|
readonly $container: AttributeDefinition;
|
|
1180
1228
|
readonly $type: 'OneOfSpec';
|
|
@@ -1363,6 +1411,8 @@ export interface QueryOption extends langium.AstNode {
|
|
|
1363
1411
|
groupByClause?: GroupByClause;
|
|
1364
1412
|
into?: SelectIntoSpec;
|
|
1365
1413
|
join?: JoinSpec;
|
|
1414
|
+
limitClause?: LimitClause;
|
|
1415
|
+
offsetClause?: OffsetClause;
|
|
1366
1416
|
orderByClause?: OrderByClause;
|
|
1367
1417
|
upsert?: '@upsert';
|
|
1368
1418
|
where?: WhereSpec;
|
|
@@ -1374,6 +1424,8 @@ export const QueryOption = {
|
|
|
1374
1424
|
groupByClause: 'groupByClause',
|
|
1375
1425
|
into: 'into',
|
|
1376
1426
|
join: 'join',
|
|
1427
|
+
limitClause: 'limitClause',
|
|
1428
|
+
offsetClause: 'offsetClause',
|
|
1377
1429
|
orderByClause: 'orderByClause',
|
|
1378
1430
|
upsert: 'upsert',
|
|
1379
1431
|
where: 'where'
|
|
@@ -1744,6 +1796,7 @@ export interface RuntimeHint extends langium.AstNode {
|
|
|
1744
1796
|
readonly $type: 'RuntimeHint';
|
|
1745
1797
|
aliasSpec?: AliasSpec;
|
|
1746
1798
|
catchSpec?: CatchSpec;
|
|
1799
|
+
emptySpec?: EmptySpec;
|
|
1747
1800
|
thenSpec?: ThenSpec;
|
|
1748
1801
|
}
|
|
1749
1802
|
|
|
@@ -1751,6 +1804,7 @@ export const RuntimeHint = {
|
|
|
1751
1804
|
$type: 'RuntimeHint',
|
|
1752
1805
|
aliasSpec: 'aliasSpec',
|
|
1753
1806
|
catchSpec: 'catchSpec',
|
|
1807
|
+
emptySpec: 'emptySpec',
|
|
1754
1808
|
thenSpec: 'thenSpec'
|
|
1755
1809
|
} as const;
|
|
1756
1810
|
|
|
@@ -1864,7 +1918,7 @@ export function isStandaloneStatement(item: unknown): item is StandaloneStatemen
|
|
|
1864
1918
|
}
|
|
1865
1919
|
|
|
1866
1920
|
export interface Statement extends langium.AstNode {
|
|
1867
|
-
readonly $container: ArrayLiteral | CaseEntry | ConditionalFlowStep | Else | FlowEntry | ForEach | Handler | If | StandaloneStatement | ThenSpec | WorkflowDefinition;
|
|
1921
|
+
readonly $container: ArrayLiteral | CaseEntry | ConditionalFlowStep | Else | EmptySpec | FlowEntry | ForEach | Handler | If | StandaloneStatement | ThenSpec | WorkflowDefinition;
|
|
1868
1922
|
readonly $type: 'Statement';
|
|
1869
1923
|
hints: Array<RuntimeHint>;
|
|
1870
1924
|
pattern: Pattern;
|
|
@@ -2102,6 +2156,7 @@ export type AgentlangAstType = {
|
|
|
2102
2156
|
Delete: Delete
|
|
2103
2157
|
DirectiveDefinition: DirectiveDefinition
|
|
2104
2158
|
Else: Else
|
|
2159
|
+
EmptySpec: EmptySpec
|
|
2105
2160
|
EntityActionsDefinitions: EntityActionsDefinitions
|
|
2106
2161
|
EntityDefinition: EntityDefinition
|
|
2107
2162
|
EnumSpec: EnumSpec
|
|
@@ -2127,6 +2182,7 @@ export type AgentlangAstType = {
|
|
|
2127
2182
|
JoinSpec: JoinSpec
|
|
2128
2183
|
KvPair: KvPair
|
|
2129
2184
|
KvPairs: KvPairs
|
|
2185
|
+
LimitClause: LimitClause
|
|
2130
2186
|
Literal: Literal
|
|
2131
2187
|
MapEntry: MapEntry
|
|
2132
2188
|
MapKey: MapKey
|
|
@@ -2136,6 +2192,7 @@ export type AgentlangAstType = {
|
|
|
2136
2192
|
NegExpr: NegExpr
|
|
2137
2193
|
NodeDefinition: NodeDefinition
|
|
2138
2194
|
NotExpr: NotExpr
|
|
2195
|
+
OffsetClause: OffsetClause
|
|
2139
2196
|
OneOfSpec: OneOfSpec
|
|
2140
2197
|
OrderByClause: OrderByClause
|
|
2141
2198
|
Pattern: Pattern
|
|
@@ -2517,6 +2574,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
2517
2574
|
},
|
|
2518
2575
|
superTypes: []
|
|
2519
2576
|
},
|
|
2577
|
+
EmptySpec: {
|
|
2578
|
+
name: EmptySpec.$type,
|
|
2579
|
+
properties: {
|
|
2580
|
+
stmt: {
|
|
2581
|
+
name: EmptySpec.stmt
|
|
2582
|
+
}
|
|
2583
|
+
},
|
|
2584
|
+
superTypes: []
|
|
2585
|
+
},
|
|
2520
2586
|
EntityActionsDefinitions: {
|
|
2521
2587
|
name: EntityActionsDefinitions.$type,
|
|
2522
2588
|
properties: {
|
|
@@ -2820,6 +2886,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
2820
2886
|
},
|
|
2821
2887
|
superTypes: []
|
|
2822
2888
|
},
|
|
2889
|
+
LimitClause: {
|
|
2890
|
+
name: LimitClause.$type,
|
|
2891
|
+
properties: {
|
|
2892
|
+
value: {
|
|
2893
|
+
name: LimitClause.value
|
|
2894
|
+
}
|
|
2895
|
+
},
|
|
2896
|
+
superTypes: []
|
|
2897
|
+
},
|
|
2823
2898
|
Literal: {
|
|
2824
2899
|
name: Literal.$type,
|
|
2825
2900
|
properties: {
|
|
@@ -2946,6 +3021,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
2946
3021
|
},
|
|
2947
3022
|
superTypes: [PrimExpr.$type]
|
|
2948
3023
|
},
|
|
3024
|
+
OffsetClause: {
|
|
3025
|
+
name: OffsetClause.$type,
|
|
3026
|
+
properties: {
|
|
3027
|
+
value: {
|
|
3028
|
+
name: OffsetClause.value
|
|
3029
|
+
}
|
|
3030
|
+
},
|
|
3031
|
+
superTypes: []
|
|
3032
|
+
},
|
|
2949
3033
|
OneOfSpec: {
|
|
2950
3034
|
name: OneOfSpec.$type,
|
|
2951
3035
|
properties: {
|
|
@@ -3085,6 +3169,12 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
3085
3169
|
join: {
|
|
3086
3170
|
name: QueryOption.join
|
|
3087
3171
|
},
|
|
3172
|
+
limitClause: {
|
|
3173
|
+
name: QueryOption.limitClause
|
|
3174
|
+
},
|
|
3175
|
+
offsetClause: {
|
|
3176
|
+
name: QueryOption.offsetClause
|
|
3177
|
+
},
|
|
3088
3178
|
orderByClause: {
|
|
3089
3179
|
name: QueryOption.orderByClause
|
|
3090
3180
|
},
|
|
@@ -3361,6 +3451,9 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
3361
3451
|
catchSpec: {
|
|
3362
3452
|
name: RuntimeHint.catchSpec
|
|
3363
3453
|
},
|
|
3454
|
+
emptySpec: {
|
|
3455
|
+
name: RuntimeHint.emptySpec
|
|
3456
|
+
},
|
|
3364
3457
|
thenSpec: {
|
|
3365
3458
|
name: RuntimeHint.thenSpec
|
|
3366
3459
|
}
|