agentlang 0.4.7 → 0.4.8
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/out/runtime/interpreter.d.ts.map +1 -1
- package/out/runtime/interpreter.js +3 -2
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/modules/ai.d.ts +1 -0
- package/out/runtime/modules/ai.d.ts.map +1 -1
- package/out/runtime/modules/ai.js +16 -0
- package/out/runtime/modules/ai.js.map +1 -1
- package/out/runtime/modules/auth.d.ts.map +1 -1
- package/out/runtime/modules/auth.js.map +1 -1
- package/package.json +183 -184
- package/src/runtime/interpreter.ts +9 -2
- package/src/runtime/modules/ai.ts +16 -0
- package/src/runtime/modules/auth.ts +17 -10
- package/out/runtime/modules/files.d.ts +0 -18
- package/out/runtime/modules/files.d.ts.map +0 -1
- package/out/runtime/modules/files.js +0 -116
- package/out/runtime/modules/files.js.map +0 -1
- package/out/setupClassic.d.ts +0 -98
- package/out/setupClassic.d.ts.map +0 -1
- package/out/setupClassic.js +0 -38
- package/out/setupClassic.js.map +0 -1
- package/out/setupCommon.d.ts +0 -2
- package/out/setupCommon.d.ts.map +0 -1
- package/out/setupCommon.js +0 -33
- package/out/setupCommon.js.map +0 -1
- package/out/setupExtended.d.ts +0 -40
- package/out/setupExtended.d.ts.map +0 -1
- package/out/setupExtended.js +0 -67
- package/out/setupExtended.js.map +0 -1
|
@@ -482,7 +482,7 @@ export async function inactivateUser(userId: string, env: Environment): Promise<
|
|
|
482
482
|
try {
|
|
483
483
|
// Update user status to 'Inactive'
|
|
484
484
|
await updateUserStatus(userId, 'Inactive', env);
|
|
485
|
-
|
|
485
|
+
|
|
486
486
|
// Disable user in Cognito
|
|
487
487
|
const user = await findUser(userId, env);
|
|
488
488
|
if (user) {
|
|
@@ -491,7 +491,7 @@ export async function inactivateUser(userId: string, env: Environment): Promise<
|
|
|
491
491
|
await fetchAuthImpl().disableUser(email, env);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
|
|
494
|
+
|
|
495
495
|
return {
|
|
496
496
|
status: 'ok',
|
|
497
497
|
message: 'User inactivated successfully',
|
|
@@ -515,7 +515,7 @@ export async function activateUser(userId: string, env: Environment): Promise<Re
|
|
|
515
515
|
try {
|
|
516
516
|
// Update user status to 'Active'
|
|
517
517
|
await updateUserStatus(userId, 'Active', env);
|
|
518
|
-
|
|
518
|
+
|
|
519
519
|
// Enable user in Cognito
|
|
520
520
|
const user = await findUser(userId, env);
|
|
521
521
|
if (user) {
|
|
@@ -524,7 +524,7 @@ export async function activateUser(userId: string, env: Environment): Promise<Re
|
|
|
524
524
|
await fetchAuthImpl().enableUser(email, env);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
|
|
527
|
+
|
|
528
528
|
return {
|
|
529
529
|
status: 'ok',
|
|
530
530
|
message: 'User activated successfully',
|
|
@@ -568,7 +568,14 @@ export async function ensureUser(
|
|
|
568
568
|
});
|
|
569
569
|
return user;
|
|
570
570
|
}
|
|
571
|
-
return await createUser(
|
|
571
|
+
return await createUser(
|
|
572
|
+
crypto.randomUUID(),
|
|
573
|
+
email.toLowerCase(),
|
|
574
|
+
firstName,
|
|
575
|
+
lastName,
|
|
576
|
+
env,
|
|
577
|
+
status
|
|
578
|
+
);
|
|
572
579
|
}
|
|
573
580
|
|
|
574
581
|
export async function ensureUserRoles(userid: string, userRoles: string[], env: Environment) {
|
|
@@ -1184,13 +1191,13 @@ async function verifyJwtToken(token: string, env?: Environment): Promise<ActiveS
|
|
|
1184
1191
|
|
|
1185
1192
|
// Use the local user's ID for consistency
|
|
1186
1193
|
const localUserId = localUser.lookup('id');
|
|
1187
|
-
|
|
1194
|
+
|
|
1188
1195
|
// Check if user status is 'Active'
|
|
1189
1196
|
const userStatus = localUser.lookup('status');
|
|
1190
1197
|
if (userStatus !== 'Active') {
|
|
1191
1198
|
throw new UnauthorisedError(`User account is not active. Status: ${userStatus}`);
|
|
1192
1199
|
}
|
|
1193
|
-
|
|
1200
|
+
|
|
1194
1201
|
const sess = await findUserSession(localUserId, env);
|
|
1195
1202
|
if (!sess) {
|
|
1196
1203
|
throw new UnauthorisedError(`No session found for user ${email}, UserId: ${userId}`);
|
|
@@ -1231,7 +1238,7 @@ async function verifySessionToken(token: string, env?: Environment): Promise<Act
|
|
|
1231
1238
|
throw new UnauthorisedError(`User account is not active. Status: ${userStatus}`);
|
|
1232
1239
|
}
|
|
1233
1240
|
}
|
|
1234
|
-
|
|
1241
|
+
|
|
1235
1242
|
const sess: Instance = await findSession(sessId, env);
|
|
1236
1243
|
if (sess !== undefined) {
|
|
1237
1244
|
await fetchAuthImpl().verifyToken(sess.lookup('authToken'), env);
|
|
@@ -1370,14 +1377,14 @@ export async function acceptInvitationUser(
|
|
|
1370
1377
|
const f = async () => {
|
|
1371
1378
|
try {
|
|
1372
1379
|
await fetchAuthImpl().acceptInvitation(email, tempPassword, newPassword, env);
|
|
1373
|
-
|
|
1380
|
+
|
|
1374
1381
|
// Update user status to 'Active' after accepting invitation
|
|
1375
1382
|
const user = await findUserByEmail(email.toLowerCase(), env);
|
|
1376
1383
|
if (user) {
|
|
1377
1384
|
const userId = user.lookup('id');
|
|
1378
1385
|
await updateUserStatus(userId, 'Active', env);
|
|
1379
1386
|
}
|
|
1380
|
-
|
|
1387
|
+
|
|
1381
1388
|
return {
|
|
1382
1389
|
email: email,
|
|
1383
1390
|
message: 'Invitation accepted successfully',
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Result, Environment } from '../interpreter.js';
|
|
2
|
-
import { ActiveSessionInfo } from '../auth/defs.js';
|
|
3
|
-
export declare const CoreFilesModuleName: string;
|
|
4
|
-
declare const _default: string;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare function createFileRecord(fileInfo: {
|
|
7
|
-
filename: string;
|
|
8
|
-
originalName: string;
|
|
9
|
-
mimetype: string;
|
|
10
|
-
size: number;
|
|
11
|
-
path: string;
|
|
12
|
-
uploadedBy?: string;
|
|
13
|
-
}, sessionInfo?: ActiveSessionInfo, callback?: (result: Result) => void, env?: Environment): Promise<Result>;
|
|
14
|
-
export declare function findFileByFilename(filename: string, sessionInfo?: ActiveSessionInfo, callback?: (result: Result) => void, env?: Environment): Promise<Result>;
|
|
15
|
-
export declare function deleteFileRecord(filename: string, sessionInfo?: ActiveSessionInfo, callback?: (result: Result) => void, env?: Environment): Promise<Result>;
|
|
16
|
-
export declare function listAllFiles(sessionInfo?: ActiveSessionInfo, callback?: (result: Result) => void, env?: Environment): Promise<Result>;
|
|
17
|
-
export declare function listUserFiles(userId: string, sessionInfo?: ActiveSessionInfo, callback?: (result: Result) => void, env?: Environment): Promise<Result>;
|
|
18
|
-
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/runtime/modules/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAY,MAAM,mBAAmB,CAAC;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,eAAO,MAAM,mBAAmB,QAA8B,CAAC;;AAE/D,wBA2DE;AAEF,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE;IACR,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,EACD,WAAW,CAAC,EAAE,iBAAiB,EAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC,MAAM,CAAC,CAqBjB;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,iBAAiB,EAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,iBAAiB,EAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAsB,YAAY,CAChC,WAAW,CAAC,EAAE,iBAAiB,EAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,iBAAiB,EAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC,MAAM,CAAC,CAcjB"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { evaluate } from '../interpreter.js';
|
|
2
|
-
import { makeCoreModuleName } from '../util.js';
|
|
3
|
-
import { makeInstance, objectAsInstanceAttributes } from '../module.js';
|
|
4
|
-
import crypto from 'crypto';
|
|
5
|
-
export const CoreFilesModuleName = makeCoreModuleName('files');
|
|
6
|
-
export default `module ${CoreFilesModuleName}
|
|
7
|
-
|
|
8
|
-
entity File {
|
|
9
|
-
id String @id,
|
|
10
|
-
filename String @unique @indexed,
|
|
11
|
-
originalName String @optional,
|
|
12
|
-
mimetype String @default("application/octet-stream"),
|
|
13
|
-
size Int @optional,
|
|
14
|
-
uploadedBy String @optional,
|
|
15
|
-
uploadedAt DateTime @default(now()),
|
|
16
|
-
path String @optional,
|
|
17
|
-
@rbac [(roles: [*], allow: [create])
|
|
18
|
-
(allow: [read, delete], where: auth.user = this.uploadedBy)]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
workflow CreateFile {
|
|
22
|
-
{File {id CreateFile.id,
|
|
23
|
-
filename CreateFile.filename,
|
|
24
|
-
originalName CreateFile.originalName,
|
|
25
|
-
mimetype CreateFile.mimetype,
|
|
26
|
-
size CreateFile.size,
|
|
27
|
-
uploadedBy CreateFile.uploadedBy,
|
|
28
|
-
uploadedAt CreateFile.uploadedAt,
|
|
29
|
-
path CreateFile.path},
|
|
30
|
-
@upsert}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
workflow FindFile {
|
|
34
|
-
{File {id? FindFile.id}} @as [file];
|
|
35
|
-
file
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
workflow FindFileByFilename {
|
|
39
|
-
{File {filename? FindFileByFilename.filename}} @as [file];
|
|
40
|
-
file
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
workflow ListFiles {
|
|
44
|
-
{File? {}}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
workflow ListUserFiles {
|
|
48
|
-
{File {uploadedBy? ListUserFiles.userId}}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
workflow DeleteFile {
|
|
52
|
-
delete {File {id? DeleteFile.id}}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
workflow DeleteFileByFilename {
|
|
56
|
-
delete {File {filename? DeleteFileByFilename.filename}}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
workflow UpdateFile {
|
|
60
|
-
{File {id? UpdateFile.id,
|
|
61
|
-
originalName UpdateFile.originalName,
|
|
62
|
-
mimetype UpdateFile.mimetype,
|
|
63
|
-
size UpdateFile.size}}
|
|
64
|
-
}
|
|
65
|
-
`;
|
|
66
|
-
export async function createFileRecord(fileInfo, sessionInfo, callback, env) {
|
|
67
|
-
let inst = makeInstance(CoreFilesModuleName, 'CreateFile', objectAsInstanceAttributes({
|
|
68
|
-
id: crypto.randomUUID(),
|
|
69
|
-
filename: fileInfo.filename,
|
|
70
|
-
originalName: fileInfo.originalName,
|
|
71
|
-
mimetype: fileInfo.mimetype,
|
|
72
|
-
size: fileInfo.size,
|
|
73
|
-
path: fileInfo.path,
|
|
74
|
-
uploadedBy: fileInfo.uploadedBy || '',
|
|
75
|
-
uploadedAt: new Date().toISOString(),
|
|
76
|
-
}));
|
|
77
|
-
if (sessionInfo) {
|
|
78
|
-
inst = inst.setAuthContext(sessionInfo);
|
|
79
|
-
}
|
|
80
|
-
return await evaluate(inst, callback, env);
|
|
81
|
-
}
|
|
82
|
-
export async function findFileByFilename(filename, sessionInfo, callback, env) {
|
|
83
|
-
let inst = makeInstance(CoreFilesModuleName, 'FindFileByFilename', objectAsInstanceAttributes({
|
|
84
|
-
filename: filename,
|
|
85
|
-
}));
|
|
86
|
-
if (sessionInfo) {
|
|
87
|
-
inst = inst.setAuthContext(sessionInfo);
|
|
88
|
-
}
|
|
89
|
-
return await evaluate(inst, callback, env);
|
|
90
|
-
}
|
|
91
|
-
export async function deleteFileRecord(filename, sessionInfo, callback, env) {
|
|
92
|
-
let inst = makeInstance(CoreFilesModuleName, 'DeleteFileByFilename', objectAsInstanceAttributes({
|
|
93
|
-
filename: filename,
|
|
94
|
-
}));
|
|
95
|
-
if (sessionInfo) {
|
|
96
|
-
inst = inst.setAuthContext(sessionInfo);
|
|
97
|
-
}
|
|
98
|
-
return await evaluate(inst, callback, env);
|
|
99
|
-
}
|
|
100
|
-
export async function listAllFiles(sessionInfo, callback, env) {
|
|
101
|
-
let inst = makeInstance(CoreFilesModuleName, 'ListFiles', objectAsInstanceAttributes({}));
|
|
102
|
-
if (sessionInfo) {
|
|
103
|
-
inst = inst.setAuthContext(sessionInfo);
|
|
104
|
-
}
|
|
105
|
-
return await evaluate(inst, callback, env);
|
|
106
|
-
}
|
|
107
|
-
export async function listUserFiles(userId, sessionInfo, callback, env) {
|
|
108
|
-
let inst = makeInstance(CoreFilesModuleName, 'ListUserFiles', objectAsInstanceAttributes({
|
|
109
|
-
userId: userId,
|
|
110
|
-
}));
|
|
111
|
-
if (sessionInfo) {
|
|
112
|
-
inst = inst.setAuthContext(sessionInfo);
|
|
113
|
-
}
|
|
114
|
-
return await evaluate(inst, callback, env);
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/runtime/modules/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAY,YAAY,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE/D,eAAe,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D3C,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAOC,EACD,WAA+B,EAC/B,QAAmC,EACnC,GAAiB;IAEjB,IAAI,IAAI,GAAa,YAAY,CAC/B,mBAAmB,EACnB,YAAY,EACZ,0BAA0B,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC,UAAU,EAAE;QACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,UAAU,EAAE,QAAQ,CAAC,UAAU,IAAI,EAAE;QACrC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACrC,CAAC,CACH,CAAC;IAEF,IA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G,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,WAA+B,EAC/B,QAAmC,EACnC,GAAiB;IAEjB,IAAI,IAAI,GAAa,YAAY,CAC/B,mBAAmB,EACnB,eAAe,EACf,0BAA0B,CAAC;QACzB,MAAM,EAAE,MAAM;KACf,CAAC,CACH,CAAC;IAEF,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC"}
|
package/out/setupClassic.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
export declare const setupConfigClassic: () => {
|
|
2
|
-
$type: string;
|
|
3
|
-
editorAppConfig: {
|
|
4
|
-
codeResources: {
|
|
5
|
-
modified: {
|
|
6
|
-
uri: string;
|
|
7
|
-
text: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
useDiffEditor: boolean;
|
|
11
|
-
languageDef: {
|
|
12
|
-
languageExtensionConfig: {
|
|
13
|
-
id: string;
|
|
14
|
-
};
|
|
15
|
-
monarchLanguage: {
|
|
16
|
-
keywords: string[];
|
|
17
|
-
operators: string[];
|
|
18
|
-
symbols: RegExp;
|
|
19
|
-
tokenizer: {
|
|
20
|
-
initial: ({
|
|
21
|
-
regex: RegExp;
|
|
22
|
-
action: {
|
|
23
|
-
cases: {
|
|
24
|
-
'@keywords': {
|
|
25
|
-
token: string;
|
|
26
|
-
};
|
|
27
|
-
'@default': {
|
|
28
|
-
token: string;
|
|
29
|
-
};
|
|
30
|
-
'@operators'?: undefined;
|
|
31
|
-
};
|
|
32
|
-
token?: undefined;
|
|
33
|
-
};
|
|
34
|
-
include?: undefined;
|
|
35
|
-
} | {
|
|
36
|
-
regex: RegExp;
|
|
37
|
-
action: {
|
|
38
|
-
token: string;
|
|
39
|
-
cases?: undefined;
|
|
40
|
-
};
|
|
41
|
-
include?: undefined;
|
|
42
|
-
} | {
|
|
43
|
-
include: string;
|
|
44
|
-
regex?: undefined;
|
|
45
|
-
action?: undefined;
|
|
46
|
-
} | {
|
|
47
|
-
regex: RegExp;
|
|
48
|
-
action: {
|
|
49
|
-
cases: {
|
|
50
|
-
'@operators': {
|
|
51
|
-
token: string;
|
|
52
|
-
};
|
|
53
|
-
'@default': {
|
|
54
|
-
token: string;
|
|
55
|
-
};
|
|
56
|
-
'@keywords'?: undefined;
|
|
57
|
-
};
|
|
58
|
-
token?: undefined;
|
|
59
|
-
};
|
|
60
|
-
include?: undefined;
|
|
61
|
-
})[];
|
|
62
|
-
whitespace: ({
|
|
63
|
-
regex: RegExp;
|
|
64
|
-
action: {
|
|
65
|
-
token: string;
|
|
66
|
-
next?: undefined;
|
|
67
|
-
};
|
|
68
|
-
} | {
|
|
69
|
-
regex: RegExp;
|
|
70
|
-
action: {
|
|
71
|
-
token: string;
|
|
72
|
-
next: string;
|
|
73
|
-
};
|
|
74
|
-
})[];
|
|
75
|
-
comment: ({
|
|
76
|
-
regex: RegExp;
|
|
77
|
-
action: {
|
|
78
|
-
token: string;
|
|
79
|
-
next?: undefined;
|
|
80
|
-
};
|
|
81
|
-
} | {
|
|
82
|
-
regex: RegExp;
|
|
83
|
-
action: {
|
|
84
|
-
token: string;
|
|
85
|
-
next: string;
|
|
86
|
-
};
|
|
87
|
-
})[];
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
editorOptions: {
|
|
92
|
-
'semanticHighlighting.enabled': boolean;
|
|
93
|
-
theme: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
export declare const executeClassic: (htmlElement: HTMLElement) => Promise<void>;
|
|
98
|
-
//# sourceMappingURL=setupClassic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupClassic.d.ts","sourceRoot":"","sources":["../src/setupClassic.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,aAAa,WAAW,kBAgB5D,CAAC"}
|
package/out/setupClassic.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { MonacoEditorLanguageClientWrapper } from 'monaco-editor-wrapper';
|
|
2
|
-
import monarchSyntax from './syntaxes/agentlang.monarch.js';
|
|
3
|
-
export const setupConfigClassic = () => {
|
|
4
|
-
return {
|
|
5
|
-
$type: 'classic',
|
|
6
|
-
editorAppConfig: {
|
|
7
|
-
codeResources: {
|
|
8
|
-
modified: {
|
|
9
|
-
uri: '/workspace/example.al',
|
|
10
|
-
text: `// Agentlang is running in the web!`,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
useDiffEditor: false,
|
|
14
|
-
languageDef: {
|
|
15
|
-
languageExtensionConfig: { id: 'agentlang' },
|
|
16
|
-
monarchLanguage: monarchSyntax,
|
|
17
|
-
},
|
|
18
|
-
editorOptions: {
|
|
19
|
-
'semanticHighlighting.enabled': true,
|
|
20
|
-
theme: 'vs-dark',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export const executeClassic = async (htmlElement) => {
|
|
26
|
-
try {
|
|
27
|
-
const config = setupConfigClassic();
|
|
28
|
-
const wrapper = new MonacoEditorLanguageClientWrapper();
|
|
29
|
-
// Add the HTML container to the config
|
|
30
|
-
const wrapperConfig = Object.assign(Object.assign({}, config), { htmlContainer: htmlElement });
|
|
31
|
-
// Initialize and start the wrapper
|
|
32
|
-
await wrapper.initAndStart(wrapperConfig);
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
console.error('Error initializing monaco editor:', error);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=setupClassic.js.map
|
package/out/setupClassic.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupClassic.js","sourceRoot":"","sources":["../src/setupClassic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAsB,MAAM,uBAAuB,CAAC;AAC9F,OAAO,aAAa,MAAM,iCAAiC,CAAC;AAE5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,eAAe,EAAE;YACf,aAAa,EAAE;gBACb,QAAQ,EAAE;oBACR,GAAG,EAAE,uBAAuB;oBAC5B,IAAI,EAAE,qCAAqC;iBAC5C;aACF;YACD,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE;gBACX,uBAAuB,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;gBAC5C,eAAe,EAAE,aAAa;aAC/B;YACD,aAAa,EAAE;gBACb,8BAA8B,EAAE,IAAI;gBACpC,KAAK,EAAE,SAAS;aACjB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,WAAwB,EAAE,EAAE;IAC/D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,iCAAiC,EAAE,CAAC;QAExD,uCAAuC;QACvC,MAAM,aAAa,GAAG,gCACjB,MAAM,KACT,aAAa,EAAE,WAAW,GACV,CAAC;QAEnB,mCAAmC;QACnC,MAAM,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC"}
|
package/out/setupCommon.d.ts
DELETED
package/out/setupCommon.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupCommon.d.ts","sourceRoot":"","sources":["../src/setupCommon.ts"],"names":[],"mappings":""}
|
package/out/setupCommon.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// This file is kept for reference but is not used directly anymore
|
|
2
|
-
// The monaco-editor-wrapper API has changed significantly in v6+
|
|
3
|
-
export {};
|
|
4
|
-
// These functions are kept for reference but not used directly anymore
|
|
5
|
-
/*
|
|
6
|
-
export const defineUserServices = () => {
|
|
7
|
-
return {
|
|
8
|
-
userServices: {
|
|
9
|
-
// This API has changed in the latest version
|
|
10
|
-
},
|
|
11
|
-
debugLogging: true,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const configureMonacoWorkers = () => {
|
|
16
|
-
// This function is kept for compatibility, but implementation has changed
|
|
17
|
-
// Use configureDefaultWorkerFactory from monaco-editor-wrapper/workers/workerLoaders in newer code
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const configureWorker = () => {
|
|
21
|
-
// vite does not extract the worker properly if it is URL is a variable
|
|
22
|
-
const lsWorker = new Worker(new URL('./language/main-browser', import.meta.url), {
|
|
23
|
-
type: 'module',
|
|
24
|
-
name: 'Agentlang Language Server',
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
type: 'WorkerDirect',
|
|
29
|
-
worker: lsWorker,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
*/
|
|
33
|
-
//# sourceMappingURL=setupCommon.js.map
|
package/out/setupCommon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupCommon.js","sourceRoot":"","sources":["../src/setupCommon.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,iEAAiE;;AAEjE,uEAAuE;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BE"}
|
package/out/setupExtended.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare const setupConfigExtended: () => {
|
|
2
|
-
$type: string;
|
|
3
|
-
editorAppConfig: {
|
|
4
|
-
codeResources: {
|
|
5
|
-
modified: {
|
|
6
|
-
uri: string;
|
|
7
|
-
text: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
useDiffEditor: boolean;
|
|
11
|
-
extensions: {
|
|
12
|
-
config: {
|
|
13
|
-
name: string;
|
|
14
|
-
publisher: string;
|
|
15
|
-
version: string;
|
|
16
|
-
engines: {
|
|
17
|
-
vscode: string;
|
|
18
|
-
};
|
|
19
|
-
contributes: {
|
|
20
|
-
languages: {
|
|
21
|
-
id: string;
|
|
22
|
-
extensions: string[];
|
|
23
|
-
configuration: string;
|
|
24
|
-
}[];
|
|
25
|
-
grammars: {
|
|
26
|
-
language: string;
|
|
27
|
-
scopeName: string;
|
|
28
|
-
path: string;
|
|
29
|
-
}[];
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
filesOrContents: Map<any, any>;
|
|
33
|
-
}[];
|
|
34
|
-
userConfiguration: {
|
|
35
|
-
json: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export declare const executeExtended: (htmlElement: HTMLElement) => Promise<void>;
|
|
40
|
-
//# sourceMappingURL=setupExtended.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupExtended.d.ts","sourceRoot":"","sources":["../src/setupExtended.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D/B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,aAAa,WAAW,kBAgB7D,CAAC"}
|
package/out/setupExtended.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { MonacoEditorLanguageClientWrapper } from 'monaco-editor-wrapper';
|
|
2
|
-
export const setupConfigExtended = () => {
|
|
3
|
-
const extensionFilesOrContents = new Map();
|
|
4
|
-
extensionFilesOrContents.set('/language-configuration.json', new URL('../language-configuration.json', import.meta.url));
|
|
5
|
-
extensionFilesOrContents.set('/agentlang-grammar.json', new URL('../syntaxes/agentlang.tmLanguage.json', import.meta.url));
|
|
6
|
-
return {
|
|
7
|
-
$type: 'extended',
|
|
8
|
-
editorAppConfig: {
|
|
9
|
-
codeResources: {
|
|
10
|
-
modified: {
|
|
11
|
-
uri: '/workspace/example.al',
|
|
12
|
-
text: `// Agentlang is running in the web!`,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
useDiffEditor: false,
|
|
16
|
-
extensions: [
|
|
17
|
-
{
|
|
18
|
-
config: {
|
|
19
|
-
name: 'agentlang-web',
|
|
20
|
-
publisher: 'generator-langium',
|
|
21
|
-
version: '1.0.0',
|
|
22
|
-
engines: {
|
|
23
|
-
vscode: '*',
|
|
24
|
-
},
|
|
25
|
-
contributes: {
|
|
26
|
-
languages: [
|
|
27
|
-
{
|
|
28
|
-
id: 'agentlang',
|
|
29
|
-
extensions: ['.agentlang'],
|
|
30
|
-
configuration: './language-configuration.json',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
grammars: [
|
|
34
|
-
{
|
|
35
|
-
language: 'agentlang',
|
|
36
|
-
scopeName: 'source.agentlang',
|
|
37
|
-
path: './agentlang-grammar.json',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
filesOrContents: extensionFilesOrContents,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
userConfiguration: {
|
|
46
|
-
json: JSON.stringify({
|
|
47
|
-
'workbench.colorTheme': 'Default Dark Modern',
|
|
48
|
-
'editor.semanticHighlighting.enabled': true,
|
|
49
|
-
}),
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export const executeExtended = async (htmlElement) => {
|
|
55
|
-
try {
|
|
56
|
-
const config = setupConfigExtended();
|
|
57
|
-
const wrapper = new MonacoEditorLanguageClientWrapper();
|
|
58
|
-
// Add the HTML container to the config
|
|
59
|
-
const wrapperConfig = Object.assign(Object.assign({}, config), { htmlContainer: htmlElement });
|
|
60
|
-
// Initialize and start the wrapper
|
|
61
|
-
await wrapper.initAndStart(wrapperConfig);
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.error('Error initializing monaco editor:', error);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=setupExtended.js.map
|
package/out/setupExtended.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupExtended.js","sourceRoot":"","sources":["../src/setupExtended.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAsB,MAAM,uBAAuB,CAAC;AAE9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;IAC3C,wBAAwB,CAAC,GAAG,CAC1B,8BAA8B,EAC9B,IAAI,GAAG,CAAC,gCAAgC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC3D,CAAC;IACF,wBAAwB,CAAC,GAAG,CAC1B,yBAAyB,EACzB,IAAI,GAAG,CAAC,uCAAuC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAClE,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,UAAU;QACjB,eAAe,EAAE;YACf,aAAa,EAAE;gBACb,QAAQ,EAAE;oBACR,GAAG,EAAE,uBAAuB;oBAC5B,IAAI,EAAE,qCAAqC;iBAC5C;aACF;YACD,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE;gBACV;oBACE,MAAM,E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