Skip to content

Commit 4da2934

Browse files
committed
Fix session helper on Python 3.9
1 parent 525aa09 commit 4da2934

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

claude-plugin/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "wiki",
33
"description": "LLM-compiled knowledge base. Natural language routing, collector catalogs, topic archive lifecycle, inventory tracking, dataset manifests, collection ingestion for external wikis/spec repos, truth-seeking audits, session resume, automated session capture, context rehydration, concurrent-safe derived indexes, topic-isolated wikis, parallel multi-agent research, thesis-driven investigation, repo assessment, Obsidian dual-linking, retardmax mode, and --min-time sustained research.",
4-
"version": "0.11.0",
4+
"version": "0.11.1",
55
"author": {
66
"name": "nvk"
77
},

plugins/llm-wiki/.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wiki",
3-
"version": "0.11.0",
3+
"version": "0.11.1",
44
"description": "LLM-compiled knowledge bases for Codex. Build topic-scoped wikis, collect provenance-rich catalogs, archive old topics, track inventory, index datasets, capture and rehydrate session context, ingest sources, compile articles, audit, query, lint, research, and generate outputs.",
55
"author": {
66
"name": "nvk",

plugins/llm-wiki/hooks/llm_wiki_session.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from pathlib import Path
2323
from typing import Any
2424

25+
UTC = dt.timezone.utc
2526
SCHEMA_VERSION = 1
2627
DEFAULT_TOOL_THRESHOLD = 50
2728
MAX_LAST_EVENTS = 20
@@ -134,7 +135,7 @@ class HookSkip(Exception):
134135

135136

136137
def utc_now() -> str:
137-
return dt.datetime.now(dt.UTC).replace(microsecond=0).isoformat().replace("+00:00", "Z")
138+
return dt.datetime.now(UTC).replace(microsecond=0).isoformat().replace("+00:00", "Z")
138139

139140

140141
def today() -> str:
@@ -197,10 +198,10 @@ def parse_timestamp(value: str) -> dt.datetime:
197198
try:
198199
parsed = dt.datetime.fromisoformat(normalized)
199200
except ValueError:
200-
return dt.datetime.now(dt.UTC)
201+
return dt.datetime.now(UTC)
201202
if parsed.tzinfo is None:
202-
parsed = parsed.replace(tzinfo=dt.UTC)
203-
return parsed.astimezone(dt.UTC)
203+
parsed = parsed.replace(tzinfo=UTC)
204+
return parsed.astimezone(UTC)
204205

205206

206207
def atomic_write(path: Path, text: str) -> None:

scripts/llm-wiki-session

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import textwrap
2222
from pathlib import Path
2323
from typing import Any
2424

25+
UTC = dt.timezone.utc
2526
SCHEMA_VERSION = 1
2627
DEFAULT_TOOL_THRESHOLD = 50
2728
MAX_LAST_EVENTS = 20
@@ -134,7 +135,7 @@ class HookSkip(Exception):
134135

135136

136137
def utc_now() -> str:
137-
return dt.datetime.now(dt.UTC).replace(microsecond=0).isoformat().replace("+00:00", "Z")
138+
return dt.datetime.now(UTC).replace(microsecond=0).isoformat().replace("+00:00", "Z")
138139

139140

140141
def today() -> str:
@@ -197,10 +198,10 @@ def parse_timestamp(value: str) -> dt.datetime:
197198
try:
198199
parsed = dt.datetime.fromisoformat(normalized)
199200
except ValueError:
200-
return dt.datetime.now(dt.UTC)
201+
return dt.datetime.now(UTC)
201202
if parsed.tzinfo is None:
202-
parsed = parsed.replace(tzinfo=dt.UTC)
203-
return parsed.astimezone(dt.UTC)
203+
parsed = parsed.replace(tzinfo=UTC)
204+
return parsed.astimezone(UTC)
204205

205206

206207
def atomic_write(path: Path, text: str) -> None:

0 commit comments

Comments
 (0)