@almadar/agent 1.6.4 → 2.0.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/LICENSE CHANGED
@@ -1,72 +1,21 @@
1
- Business Source License 1.1
2
-
3
- Parameters
4
-
5
- Licensor: Almadar FZE
6
- Licensed Work: KFlow Builder / Almadar
7
- The Licensed Work is (c) 2025-2026 Almadar FZE.
8
- Additional Use Grant: You may make production use of the Licensed Work for
9
- non-commercial purposes and for internal evaluation.
10
- Production use for commercial purposes requires a
11
- commercial license from the Licensor.
12
- Change Date: 2030-02-01
13
- Change License: Apache License, Version 2.0
14
-
15
- Terms
16
-
17
- The Licensor hereby grants you the right to copy, modify, create derivative
18
- works, redistribute, and make non-production use of the Licensed Work. The
19
- Licensor may make an Additional Use Grant, above, permitting limited
20
- production use.
21
-
22
- Effective on the Change Date, or the fourth anniversary of the first publicly
23
- available distribution of a specific version of the Licensed Work under this
24
- License, whichever comes first, the Licensor hereby grants you rights under
25
- the terms of the Change License, and the rights granted in the paragraph
26
- above terminate.
27
-
28
- If your use of the Licensed Work does not comply with the requirements
29
- currently in effect as described in this License, you must purchase a
30
- commercial license from the Licensor, its affiliated entities, or authorized
31
- resellers, or you must refrain from using the Licensed Work.
32
-
33
- All copies of the original and modified Licensed Work, and derivative works
34
- of the Licensed Work, are subject to this License. This License applies
35
- separately for each version of the Licensed Work and the Change Date may vary
36
- for each version of the Licensed Work released by Licensor.
37
-
38
- You must conspicuously display this License on each original or modified copy
39
- of the Licensed Work. If you receive the Licensed Work in original or
40
- modified form from a third party, the terms and conditions set forth in this
41
- License apply to your use of that work.
42
-
43
- Any use of the Licensed Work in violation of this License will automatically
44
- terminate your rights under this License for the current and all other
45
- versions of the Licensed Work.
46
-
47
- This License does not grant you any right in any trademark or logo of
48
- Licensor or its affiliates (provided that you may use a trademark or logo of
49
- Licensor as expressly required by this License).
50
-
51
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
52
- AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
53
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
54
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
55
- TITLE.
56
-
57
- ---
58
-
59
- License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
60
- "Business Source License" is a trademark of MariaDB Corporation Ab.
61
-
62
- ADDITIONAL TERMS:
63
-
64
- Documentation (builder/packages/website/docs/) is licensed under CC BY 4.0.
65
-
66
- TRADEMARKS:
67
-
68
- "Orbital", "KFlow", "Almadar", and the Almadar logo are trademarks of
69
- Almadar FZE. You may not use these trademarks without prior written
70
- permission from Almadar FZE.
71
-
72
- For licensing inquiries: licensing@almadar.io
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Almadar Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @almadar/agent
2
+
3
+ > AI agent infrastructure for Almadar orbital schema generation
4
+
5
+ Part of the [Almadar](https://github.com/almadar-io/almadar) platform.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @almadar/agent
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import { /* ... */ } from '@almadar/agent';
17
+ ```
18
+
19
+ ## API
20
+
21
+ <!-- Document public exports here -->
22
+
23
+ ## License
24
+
25
+ MIT
package/dist/index.js CHANGED
@@ -10149,6 +10149,10 @@ var GitClient = class {
10149
10149
  constructor(cwd) {
10150
10150
  this.cwd = cwd;
10151
10151
  }
10152
+ /** Get the working directory path. */
10153
+ getCwd() {
10154
+ return this.cwd;
10155
+ }
10152
10156
  /** Check if git is available on the system. */
10153
10157
  static async isAvailable() {
10154
10158
  try {
@@ -10279,6 +10283,7 @@ var GitSink = class {
10279
10283
  this.name = "git";
10280
10284
  this.commitQueue = Promise.resolve();
10281
10285
  this.available = null;
10286
+ this.pushConfig = null;
10282
10287
  this.client = new GitClient(workspaceRoot);
10283
10288
  }
10284
10289
  /** Initialize the git repo. Must be called before onFileWritten. */
@@ -10290,6 +10295,17 @@ var GitSink = class {
10290
10295
  }
10291
10296
  await this.client.init();
10292
10297
  }
10298
+ /**
10299
+ * Enable pushing to a remote GitHub repo on session end.
10300
+ * Push failures are non-fatal — local commits are always preserved.
10301
+ */
10302
+ enablePush(config) {
10303
+ this.pushConfig = config;
10304
+ }
10305
+ /** Get the working directory path. */
10306
+ getCwd() {
10307
+ return this.client.getCwd();
10308
+ }
10293
10309
  async onFileWritten(path11, _content, meta) {
10294
10310
  if (!this.available) return;
10295
10311
  this.commitQueue = this.commitQueue.then(async () => {
@@ -10311,6 +10327,29 @@ var GitSink = class {
10311
10327
  `session/${sessionId}`,
10312
10328
  `Session ${sessionId} complete`
10313
10329
  );
10330
+ if (this.pushConfig) {
10331
+ await this.pushToRemote();
10332
+ }
10333
+ }
10334
+ /**
10335
+ * Push local commits to the remote GitHub repository.
10336
+ * Non-fatal — failures are logged but do not throw.
10337
+ */
10338
+ async pushToRemote() {
10339
+ if (!this.pushConfig) return;
10340
+ const { token, branch, repoUrl } = this.pushConfig;
10341
+ const cwd = this.client.getCwd();
10342
+ try {
10343
+ console.log(`[GitSink] Pushing to ${repoUrl} branch ${branch}...`);
10344
+ const { push } = await import('@almadar/integrations/github');
10345
+ await push({ branchName: branch, workDir: cwd }, cwd, token);
10346
+ console.log(`[GitSink] Push successful`);
10347
+ } catch (error) {
10348
+ console.error(
10349
+ `[GitSink] Push failed (local commits preserved):`,
10350
+ error instanceof Error ? error.message : error
10351
+ );
10352
+ }
10314
10353
  }
10315
10354
  };
10316
10355
  function formatCommitMessage(path11, meta) {