opencode-jobs 0.2.0 → 1.1.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/dist/install.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type StorageMigration } from "./migration.js";
1
2
  export declare const PACKAGE_NAME = "opencode-jobs";
2
3
  export declare const SKILL_NAME = "opencode-jobs";
3
4
  export type ConfigInstall = {
@@ -15,6 +16,7 @@ export interface ProjectInstall {
15
16
  projectDirectory: string;
16
17
  plugin: ConfigInstall;
17
18
  skill: SkillInstall;
19
+ migration?: StorageMigration;
18
20
  }
19
21
  export declare function installPluginConfig(projectDirectory: string): ConfigInstall;
20
22
  export declare function installSkill(projectDirectory: string, packageDirectory: string): SkillInstall;
@@ -39,6 +41,7 @@ export interface ProjectUninstall {
39
41
  plugin: ConfigUninstall;
40
42
  skill: SkillUninstall;
41
43
  purge?: PurgeResult;
44
+ migration?: StorageMigration;
42
45
  }
43
46
  export declare function uninstallPluginConfig(projectDirectory: string): ConfigUninstall;
44
47
  export declare function uninstallSkill(projectDirectory: string, packageDirectory: string): SkillUninstall;
@@ -0,0 +1,9 @@
1
+ export type ManagementResult = {
2
+ ok: true;
3
+ output: string;
4
+ } | {
5
+ ok: false;
6
+ output: string;
7
+ };
8
+ export declare function listJobs(directory: string): ManagementResult;
9
+ export declare function runJobNow(slugInput: string, directory: string): ManagementResult;
@@ -0,0 +1,9 @@
1
+ export interface StorageMigration {
2
+ moved: {
3
+ from: string;
4
+ to: string;
5
+ }[];
6
+ resyncedProjects: string[];
7
+ warnings: string[];
8
+ }
9
+ export declare function migrateStorage(projectDirectory: string, shouldResync: boolean): StorageMigration;
package/dist/paths.d.ts CHANGED
@@ -2,7 +2,7 @@ export declare function configRoot(): string;
2
2
  export declare function stateRoot(): string;
3
3
  export declare function worktreesDirectory(scopeId: string): string;
4
4
  export declare function locksDirectory(scopeId: string): string;
5
- export declare function schedulerDirectory(): string;
5
+ export declare function jobsStateDirectory(): string;
6
6
  export declare function registryPath(): string;
7
7
  export declare function scopeDirectory(scopeId: string): string;
8
8
  export declare function runsDirectory(scopeId: string): string;
@@ -9,6 +9,7 @@ export interface Registry {
9
9
  version: 1;
10
10
  projects: Record<string, RegistryEntry>;
11
11
  }
12
+ export declare function readRegistryFile(file: string): Registry;
12
13
  export declare function loadRegistry(): Registry;
13
14
  export declare function saveRegistry(registry: Registry): void;
14
15
  export declare function registryEntry(workdir: string): RegistryEntry | undefined;
package/dist/systemd.d.ts CHANGED
@@ -22,5 +22,5 @@ export interface TimerStatus {
22
22
  }
23
23
  export declare function timerStatus(base: string): TimerStatus;
24
24
  export declare function writeJobUnits(job: Job, workdir: string, scopeId: string, opencodeBin: string, pathEnvironment: string): string;
25
- export declare function removeJobUnits(scopeId: string, slug: string): void;
25
+ export declare function removeJobUnits(scopeId: string, slug: string): string | undefined;
26
26
  export declare function removeStaleUnits(scopeId: string, expectedSlugs: Set<string>): string[];
package/dist/tools.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { type ToolDefinition } from "@opencode-ai/plugin";
2
- export declare const schedulerTools: Record<string, ToolDefinition>;
2
+ export declare const jobsTools: Record<string, ToolDefinition>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-jobs",
3
- "version": "0.2.0",
3
+ "version": "1.1.0",
4
4
  "description": "opencode plugin that schedules recurring agent jobs as systemd user timers, with git-committable job definitions, run history, and session continuity",
5
5
  "type": "module",
6
6
  "engines": {
@@ -7,13 +7,13 @@ compatibility: opencode on Linux with systemd
7
7
 
8
8
  # OpenCode Jobs
9
9
 
10
- Use the `opencode-jobs` tools instead of editing systemd units or global
11
- scheduler state directly.
10
+ Use the `opencode-jobs` tools instead of editing systemd units or global job
11
+ state directly.
12
12
 
13
13
  ## Workflow
14
14
 
15
15
  1. Create or update a definition with `schedule_job`. Definitions belong in
16
- `.opencode/scheduler/jobs/<slug>.json` and should be committed with the
16
+ `.opencode/jobs/<slug>.json` and should be committed with the
17
17
  project.
18
18
  2. Inspect definitions with `list_jobs` or `get_job`.
19
19
  3. Run `enable_project` after the first job is created. Run it again to
@@ -36,7 +36,7 @@ scheduler state directly.
36
36
  - A `guard` is a shell command that must exit zero for the job to run.
37
37
  - Set `worktree: true` when the job should not touch the user's checkout:
38
38
  each run gets a fresh git worktree (default base
39
- `~/.local/state/opencode/scheduler/worktrees/…`, override with
39
+ `~/.local/state/opencode/jobs/worktrees/…`, override with
40
40
  `worktree.base`), all changes are committed to a per-run branch
41
41
  `opencode-jobs/<slug>/…`, and the worktree is removed. Overlapping runs
42
42
  of the same job are skipped via a lock; subdirectory projects run in