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.
- checksums.yaml +4 -4
- data/README.md +316 -308
- data/lib/enconvert/v2.rb +762 -688
- data/lib/enconvert/v2_results.rb +144 -130
- data/lib/enconvert/version.rb +5 -5
- metadata +2 -2
data/lib/enconvert/v2_results.rb
CHANGED
|
@@ -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
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
:
|
|
102
|
-
keyword_init: true
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
:
|
|
109
|
-
:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
:
|
|
125
|
-
keyword_init: true
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
data/lib/enconvert/version.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Enconvert
|
|
4
|
-
VERSION = "0.0
|
|
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
|
|
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-
|
|
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
|