enconvert 0.0.1 → 0.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.
@@ -1,130 +1,144 @@
1
- # frozen_string_literal: true
2
-
3
- # V2 response types, returned as plain read-only Structs with snake_case
4
- # readers. Fields documented as optional may be `nil` — the API omits
5
- # unset fields entirely (response_model_exclude_none) and every mapper
6
- # guards each access.
7
- module Enconvert
8
- class V2
9
- # ------------------------------------------------------------------
10
- # Enumerations (documented as frozen constants; not runtime-enforced —
11
- # the wire values are plain strings, mirroring the Node SDK's
12
- # compile-time-only string union types).
13
- # ------------------------------------------------------------------
14
- module Enums
15
- PERCEIVE_OUTPUTS = %w[
16
- markdown markdown_fit html_cleaned html_raw screenshot screenshot_full_page
17
- pdf links images structured
18
- ].freeze
19
- PERCEIVE_EXTRACT_NAMES = %w[
20
- tables prices contacts metadata main_content headings structured_data technologies all
21
- ].freeze
22
- PERCEIVE_RESOURCE_TYPES = %w[
23
- image media font stylesheet script xhr fetch websocket manifest other
24
- ].freeze
25
- PERCEIVE_CACHE_MODES = %w[enabled bypass refresh].freeze
26
- PERCEIVE_STATUSES = %w[queued processing completed failed].freeze
27
- PERCEIVE_EXTRACTION_TIERS = %w[heuristic css llm].freeze
28
- PERCEIVE_BATCH_OUTPUT_MODES = %w[manifest zip].freeze
29
- PERCEIVE_BATCH_STATUSES = %w[queued processing completed failed partial].freeze
30
- DISCOVER_MODES = %w[sitemap crawl hybrid].freeze
31
- LOOKUP_CATEGORIES = %w[web news images scholar patents maps].freeze
32
- LOOKUP_TIME_FILTERS = %w[hour day week month year].freeze
33
- CSS_FIELD_TYPES = %w[text attribute html regex nested list nested_list].freeze
34
- DISTILL_EXTRACTION_TIERS = %w[css llm mixed none].freeze
35
- INGEST_MODES = %w[urls sitemap crawl files].freeze
36
- INGEST_STATUSES = %w[queued discovering processing completed failed canceled].freeze
37
- WATCH_DIFF_MODES = %w[auto text structured tables metadata].freeze
38
- WATCHER_STATUSES = %w[active paused deleted].freeze
39
- end
40
-
41
- V2Tokens = Struct.new(:input, :output, keyword_init: true)
42
-
43
- # A rendered output stored server-side, addressed by signed URL.
44
- V2OutputArtifact = Struct.new(:url, :object_key, :size_bytes, :content_type, :expires_in, keyword_init: true)
45
-
46
- PerceiveResult = Struct.new(
47
- :operation_id, :status, :url, :url_final, :content_hash, :render_quality, :cache_hit,
48
- :outputs, :structured, :extraction_tier, :tokens, :cost_cents, :duration_ms, :error, :warnings,
49
- keyword_init: true
50
- )
51
-
52
- PerceiveBatchResult = Struct.new(
53
- :job_id, :status, :output_mode, :total, :completed, :failed, :pending, :zip, :items, :warnings,
54
- keyword_init: true
55
- )
56
-
57
- DiscoverResult = Struct.new(
58
- :url, :mode, :total, :urls, :pages_crawled, :truncated, :robots_respected, :sources, :warnings,
59
- keyword_init: true
60
- )
61
-
62
- # One search hit, optionally carrying its full perceive result.
63
- LookupItem = Struct.new(
64
- :title, :url, :snippet, :position, :source, :date, :image_url, :thumbnail_url, :extra, :perceive,
65
- keyword_init: true
66
- )
67
-
68
- LookupResult = Struct.new(
69
- :lookup_id, :query, :category, :country, :locale, :time_filter, :total, :results,
70
- :perceive_top, :perceive_operation_ids, :answer_box, :knowledge_graph, :credits, :cost_cents, :warnings,
71
- keyword_init: true
72
- )
73
-
74
- DistillItem = Struct.new(
75
- :url, :url_final, :status, :data, :extraction_tier, :fields_from_css, :fields_from_llm,
76
- :render_quality, :tokens, :cost_cents, :error, :warnings,
77
- keyword_init: true
78
- )
79
-
80
- DistillResult = Struct.new(
81
- :operation_id, :total, :completed, :failed, :results, :total_cost_cents, :warnings,
82
- keyword_init: true
83
- )
84
-
85
- IngestJob = Struct.new(
86
- :job_id, :status, :mode, :pages_discovered, :pages_processed, :pages_failed, :total_chunks,
87
- :output_url, :error_message, :webhook_url, :webhook_delivered, :created_at, :completed_at, :warnings,
88
- keyword_init: true
89
- )
90
-
91
- # Compact job row from list_ingest_jobs (webhook_url replaced by a flag).
92
- IngestJobSummary = Struct.new(
93
- :job_id, :status, :mode, :pages_discovered, :pages_processed, :pages_failed, :total_chunks,
94
- :output_url, :error_message, :webhook_configured, :webhook_delivered, :created_at, :completed_at,
95
- keyword_init: true
96
- )
97
-
98
- IngestJobList = Struct.new(:jobs, :skip, :limit, :has_more, keyword_init: true)
99
-
100
- WebhookSecret = Struct.new(
101
- :secret, :signature_header, :timestamp_header, :signature_scheme, :replay_tolerance_seconds, :rotated,
102
- keyword_init: true
103
- )
104
-
105
- WebhookRetryResult = Struct.new(:job_id, :delivered, :attempts, :status_code, :detail, keyword_init: true)
106
-
107
- Watcher = Struct.new(
108
- :watcher_id, :url, :status, :frequency_minutes, :diff_mode, :track_fields, :webhook_url,
109
- :notify_email, :consecutive_errors, :checks_count, :last_check_at, :next_check_at,
110
- :last_change_at, :created_at, :updated_at,
111
- keyword_init: true
112
- )
113
-
114
- # Compact watcher row from list_watchers.
115
- WatcherSummary = Struct.new(
116
- :watcher_id, :url, :status, :frequency_minutes, :checks_count, :consecutive_errors,
117
- :last_check_at, :next_check_at, :last_change_at, :created_at,
118
- keyword_init: true
119
- )
120
-
121
- WatcherList = Struct.new(:watchers, :skip, :limit, :has_more, keyword_init: true)
122
-
123
- WatcherSnapshot = Struct.new(
124
- :checked_at, :has_changes, :similarity, :render_quality, :change_count, :changes,
125
- keyword_init: true
126
- )
127
-
128
- WatcherSnapshotList = Struct.new(:watcher_id, :snapshots, :limit, keyword_init: true)
129
- end
130
- end
1
+ # frozen_string_literal: true
2
+
3
+ # V2 response types, returned as plain read-only Structs with snake_case
4
+ # readers. Fields documented as optional may be `nil` — the API omits
5
+ # unset fields entirely (response_model_exclude_none) and every mapper
6
+ # guards each access.
7
+ module Enconvert
8
+ class V2
9
+ # ------------------------------------------------------------------
10
+ # Enumerations (documented as frozen constants; not runtime-enforced —
11
+ # the wire values are plain strings, mirroring the Node SDK's
12
+ # compile-time-only string union types).
13
+ # ------------------------------------------------------------------
14
+ module Enums
15
+ PERCEIVE_OUTPUTS = %w[
16
+ markdown html_cleaned html_raw screenshot screenshot_full_page
17
+ pdf links images structured
18
+ ].freeze
19
+ PERCEIVE_EXTRACT_NAMES = %w[
20
+ tables prices contacts metadata main_content headings structured_data technologies all
21
+ ].freeze
22
+ PERCEIVE_RESOURCE_TYPES = %w[
23
+ image media font stylesheet script xhr fetch websocket manifest other
24
+ ].freeze
25
+ PERCEIVE_CACHE_MODES = %w[enabled bypass refresh].freeze
26
+ PERCEIVE_STATUSES = %w[queued processing completed failed].freeze
27
+ PERCEIVE_EXTRACTION_TIERS = %w[heuristic css llm].freeze
28
+ PERCEIVE_BATCH_OUTPUT_MODES = %w[manifest zip].freeze
29
+ PERCEIVE_BATCH_STATUSES = %w[queued processing completed failed partial].freeze
30
+ DISCOVER_MODES = %w[sitemap crawl hybrid].freeze
31
+ LOOKUP_CATEGORIES = %w[web news images scholar patents maps].freeze
32
+ LOOKUP_TIME_FILTERS = %w[hour day week month year].freeze
33
+ CSS_FIELD_TYPES = %w[text attribute html regex nested list nested_list].freeze
34
+ DISTILL_EXTRACTION_TIERS = %w[css llm mixed none].freeze
35
+ INGEST_MODES = %w[urls sitemap crawl files].freeze
36
+ INGEST_STATUSES = %w[queued discovering processing completed failed canceled].freeze
37
+ WATCH_DIFF_MODES = %w[auto text structured tables metadata].freeze
38
+ WATCHER_STATUSES = %w[active paused deleted].freeze
39
+ # Artifact-producing subset of PERCEIVE_OUTPUTS accepted by direct
40
+ # download ("structured" stays inline and is never streamed).
41
+ PERCEIVE_ARTIFACT_OUTPUTS = (PERCEIVE_OUTPUTS - %w[structured]).freeze
42
+ end
43
+
44
+ V2Tokens = Struct.new(:input, :output, keyword_init: true)
45
+
46
+ # A rendered output stored server-side, addressed by signed URL.
47
+ V2OutputArtifact = Struct.new(:url, :object_key, :size_bytes, :content_type, :expires_in, keyword_init: true)
48
+
49
+ PerceiveResult = Struct.new(
50
+ :operation_id, :status, :url, :url_final, :content_hash, :render_quality, :cache_hit,
51
+ :outputs, :structured, :extraction_tier, :tokens, :cost_cents, :duration_ms, :error, :warnings,
52
+ :status_code, :deductions, :options_echo,
53
+ keyword_init: true
54
+ )
55
+
56
+ # Raw artifact bytes returned by perceive_direct /
57
+ # download_perceive_artifact. The HTTP body is the artifact itself
58
+ # (`content`, a binary String); metadata is parsed from the response
59
+ # headers (absent headers map to nil / 0).
60
+ PerceiveDirectResult = Struct.new(
61
+ :content, :content_type, :filename, :operation_id, :object_key, :cache_hit,
62
+ :render_quality, :source_status_code, :content_hash, :warnings_count,
63
+ keyword_init: true
64
+ )
65
+
66
+ PerceiveBatchResult = Struct.new(
67
+ :job_id, :status, :output_mode, :total, :completed, :failed, :pending, :zip, :items, :warnings,
68
+ keyword_init: true
69
+ )
70
+
71
+ DiscoverResult = Struct.new(
72
+ :url, :mode, :total, :urls, :pages_crawled, :truncated, :robots_respected, :sources, :warnings,
73
+ keyword_init: true
74
+ )
75
+
76
+ # One search hit, optionally carrying its full perceive result.
77
+ LookupItem = Struct.new(
78
+ :title, :url, :snippet, :position, :source, :date, :image_url, :thumbnail_url, :extra, :perceive,
79
+ keyword_init: true
80
+ )
81
+
82
+ LookupResult = Struct.new(
83
+ :lookup_id, :query, :category, :country, :locale, :time_filter, :total, :results,
84
+ :perceive_top, :perceive_operation_ids, :answer_box, :knowledge_graph, :credits, :cost_cents, :warnings,
85
+ keyword_init: true
86
+ )
87
+
88
+ DistillItem = Struct.new(
89
+ :url, :url_final, :status, :data, :extraction_tier, :fields_from_css, :fields_from_llm,
90
+ :render_quality, :tokens, :cost_cents, :error, :warnings,
91
+ keyword_init: true
92
+ )
93
+
94
+ DistillResult = Struct.new(
95
+ :operation_id, :total, :completed, :failed, :results, :total_cost_cents, :warnings,
96
+ keyword_init: true
97
+ )
98
+
99
+ IngestJob = Struct.new(
100
+ :job_id, :status, :mode, :pages_discovered, :pages_processed, :pages_failed, :total_chunks,
101
+ :output_url, :error_message, :webhook_url, :webhook_delivered, :created_at, :completed_at, :warnings,
102
+ keyword_init: true
103
+ )
104
+
105
+ # Compact job row from list_ingest_jobs (webhook_url replaced by a flag).
106
+ IngestJobSummary = Struct.new(
107
+ :job_id, :status, :mode, :pages_discovered, :pages_processed, :pages_failed, :total_chunks,
108
+ :output_url, :error_message, :webhook_configured, :webhook_delivered, :created_at, :completed_at,
109
+ keyword_init: true
110
+ )
111
+
112
+ IngestJobList = Struct.new(:jobs, :skip, :limit, :has_more, keyword_init: true)
113
+
114
+ WebhookSecret = Struct.new(
115
+ :secret, :signature_header, :timestamp_header, :signature_scheme, :replay_tolerance_seconds, :rotated,
116
+ keyword_init: true
117
+ )
118
+
119
+ WebhookRetryResult = Struct.new(:job_id, :delivered, :attempts, :status_code, :detail, keyword_init: true)
120
+
121
+ Watcher = Struct.new(
122
+ :watcher_id, :url, :status, :frequency_minutes, :diff_mode, :track_fields, :webhook_url,
123
+ :notify_email, :consecutive_errors, :checks_count, :last_check_at, :next_check_at,
124
+ :last_change_at, :created_at, :updated_at,
125
+ keyword_init: true
126
+ )
127
+
128
+ # Compact watcher row from list_watchers.
129
+ WatcherSummary = Struct.new(
130
+ :watcher_id, :url, :status, :frequency_minutes, :checks_count, :consecutive_errors,
131
+ :last_check_at, :next_check_at, :last_change_at, :created_at,
132
+ keyword_init: true
133
+ )
134
+
135
+ WatcherList = Struct.new(:watchers, :skip, :limit, :has_more, keyword_init: true)
136
+
137
+ WatcherSnapshot = Struct.new(
138
+ :checked_at, :has_changes, :similarity, :render_quality, :change_count, :changes,
139
+ keyword_init: true
140
+ )
141
+
142
+ WatcherSnapshotList = Struct.new(:watcher_id, :snapshots, :limit, keyword_init: true)
143
+ end
144
+ end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module Enconvert
4
- VERSION = "0.0.1"
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Enconvert
4
+ VERSION = "0.1.0"
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enconvert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enconvert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-15 00:00:00.000000000 Z
11
+ date: 2026-08-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Enconvert reads any web page or file into agent-ready Markdown, JSON,
14
14
  or screenshots -- every read scored 0.0-1.0 for render quality, so blocked or empty-shell