astrocode-workflow 0.4.3 → 0.4.5

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.
@@ -103,7 +103,7 @@ export function createInjectProvider(opts) {
103
103
  continue;
104
104
  }
105
105
  // Format as injection message
106
- const formattedText = `[Inject: ${inject.title}]\n\n${inject.body_md}`;
106
+ const formattedText = `### 🔖 ASTROCODE: INJECTED NOTE\n**Title:** ${inject.title}\n\n${inject.body_md}`;
107
107
  try {
108
108
  await injectChatPrompt({
109
109
  ctx,
@@ -170,6 +170,8 @@ export function createInjectProvider(opts) {
170
170
  return;
171
171
  // Inject eligible injects before processing the user's message
172
172
  await injectEligibleInjects(input.sessionID, 'chat_message');
173
+ // Also inject Workflow Pulse on chat messages if a run is active
174
+ await maybeInjectWorkflowPulse(input.sessionID);
173
175
  },
174
176
  async onToolAfter(input) {
175
177
  if (!config.inject?.enabled)
@@ -30,33 +30,11 @@ export function createAstroResetTool(opts) {
30
30
  lines.push("🗑️ Astrocode Database Reset");
31
31
  lines.push(`- Repo: ${repoRoot}`);
32
32
  lines.push(`- Target: ${fullDbPath}`);
33
- // Check for lock file
34
- const lockPath = `${repoRoot}/.astro/astro.lock`;
35
- if (fs.existsSync(lockPath)) {
36
- try {
37
- const lockContent = fs.readFileSync(lockPath, "utf8").trim();
38
- const pid = parseInt(lockContent.split(" ")[0]);
39
- lines.push(`- Lock file found for PID ${pid}`);
40
- // Try to kill the process
41
- try {
42
- process.kill(pid, 'SIGTERM');
43
- lines.push(`- Sent SIGTERM to PID ${pid}, waiting 2s...`);
44
- await new Promise(resolve => setTimeout(resolve, 2000));
45
- }
46
- catch (e) {
47
- lines.push(`- Could not kill PID ${pid}: ${String(e)}`);
48
- }
49
- }
50
- catch (e) {
51
- lines.push(`- Error reading lock file: ${String(e)}`);
52
- }
53
- }
54
33
  // Delete DB files
55
34
  const filesToDelete = [
56
35
  fullDbPath,
57
36
  `${fullDbPath}-wal`,
58
37
  `${fullDbPath}-shm`,
59
- lockPath,
60
38
  ];
61
39
  let deletedCount = 0;
62
40
  for (const filePath of filesToDelete) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astrocode-workflow",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -145,7 +145,7 @@ export function createInjectProvider(opts: {
145
145
  }
146
146
 
147
147
  // Format as injection message
148
- const formattedText = `[Inject: ${inject.title}]\n\n${inject.body_md}`;
148
+ const formattedText = `### 🔖 ASTROCODE: INJECTED NOTE\n**Title:** ${inject.title}\n\n${inject.body_md}`;
149
149
 
150
150
  try {
151
151
  await injectChatPrompt({
@@ -219,6 +219,9 @@ export function createInjectProvider(opts: {
219
219
 
220
220
  // Inject eligible injects before processing the user's message
221
221
  await injectEligibleInjects(input.sessionID, 'chat_message');
222
+
223
+ // Also inject Workflow Pulse on chat messages if a run is active
224
+ await maybeInjectWorkflowPulse(input.sessionID);
222
225
  },
223
226
 
224
227
  async onToolAfter(input: ToolExecuteAfterInput) {
@@ -37,34 +37,11 @@ export function createAstroResetTool(opts: { ctx: any; config: AstrocodeConfig;
37
37
  lines.push(`- Repo: ${repoRoot}`);
38
38
  lines.push(`- Target: ${fullDbPath}`);
39
39
 
40
- // Check for lock file
41
- const lockPath = `${repoRoot}/.astro/astro.lock`;
42
- if (fs.existsSync(lockPath)) {
43
- try {
44
- const lockContent = fs.readFileSync(lockPath, "utf8").trim();
45
- const pid = parseInt(lockContent.split(" ")[0]);
46
-
47
- lines.push(`- Lock file found for PID ${pid}`);
48
-
49
- // Try to kill the process
50
- try {
51
- (process as any).kill(pid, 'SIGTERM');
52
- lines.push(`- Sent SIGTERM to PID ${pid}, waiting 2s...`);
53
- await new Promise(resolve => setTimeout(resolve, 2000));
54
- } catch (e) {
55
- lines.push(`- Could not kill PID ${pid}: ${String(e)}`);
56
- }
57
- } catch (e) {
58
- lines.push(`- Error reading lock file: ${String(e)}`);
59
- }
60
- }
61
-
62
40
  // Delete DB files
63
41
  const filesToDelete = [
64
42
  fullDbPath,
65
43
  `${fullDbPath}-wal`,
66
44
  `${fullDbPath}-shm`,
67
- lockPath,
68
45
  ];
69
46
 
70
47
  let deletedCount = 0;